Commit 2149d442 authored by 李勇諭's avatar 李勇諭

fix type

parent 7abf2bfe
...@@ -2,9 +2,6 @@ ...@@ -2,9 +2,6 @@
/node_modules /node_modules
/public /public
/src /src
/dist/index.d.ts
/dist/index.js
/dist/index.js.map
tsconfig.json tsconfig.json
tslint.json tslint.json
webpack.config.js webpack.config.js
......
{ {
"name": "react-js-pull-to-refresh", "name": "react-js-pull-to-refresh",
"version": "0.1.0", "version": "0.1.2",
"description": "React pull to refresh", "description": "React pull to refresh",
"main": "dist/PullToRefresh.js", "main": "dist/index.js",
"types": ".dist/PullToRefresh.d.ts", "types": ".dist/index.d.ts",
"scripts": { "scripts": {
"dev": "webpack-dev-server", "dev": "webpack-dev-server",
"lint": "tslint -c tslint.json src/*", "lint": "tslint -c tslint.json src/*",
......
...@@ -63,7 +63,7 @@ export class PullToRefresh extends React.Component<PullToRefreshProps, PullToRef ...@@ -63,7 +63,7 @@ export class PullToRefresh extends React.Component<PullToRefreshProps, PullToRef
} }
@autobind @autobind
private onTouchStart(e: TouchEvent) { private onTouchStart(e) {
this.dragging = true; this.dragging = true;
this.startY = e["pageY"] || e.touches[0].pageY; this.startY = e["pageY"] || e.touches[0].pageY;
this.currentY = this.startY; this.currentY = this.startY;
...@@ -73,7 +73,7 @@ export class PullToRefresh extends React.Component<PullToRefreshProps, PullToRef ...@@ -73,7 +73,7 @@ export class PullToRefresh extends React.Component<PullToRefreshProps, PullToRef
} }
@autobind @autobind
private onTouchMove(e: TouchEvent) { private onTouchMove(e) {
if (!this.dragging) { if (!this.dragging) {
return; return;
} }
......
import {PullToRefresh} from "./PullToRefresh";
export {PullToRefresh};
...@@ -13,7 +13,7 @@ module.exports = { ...@@ -13,7 +13,7 @@ module.exports = {
"react-hot-loader/patch", // activate HMR for React "react-hot-loader/patch", // activate HMR for React
"webpack-dev-server/client?http://localhost:8080/", "webpack-dev-server/client?http://localhost:8080/",
"webpack/hot/only-dev-server", "webpack/hot/only-dev-server",
"./src/index.tsx" "./src/dev.tsx"
], ],
output: { output: {
filename: "bundle.js", filename: "bundle.js",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment