diff --git a/SmartRefreshControl.js b/SmartRefreshControl.js index 9fbdc44..accbe29 100644 --- a/SmartRefreshControl.js +++ b/SmartRefreshControl.js @@ -48,7 +48,7 @@ class SmartRefreshControl extends Component { return findNodeHandle(this.refs.refreshLayout); } - componentWillMount() { + componentDidMount() { this._panResponder = PanResponder.create({ onMoveShouldSetPanResponderCapture: (evt, gestureState) => { if(this.shiftPercent >= 0.039 || this.footerShiftPercent >= 0.068){//满足条件捕获事件 @@ -127,7 +127,7 @@ class SmartRefreshControl extends Component { {this.renderHeader()} {this.props.children} @@ -169,4 +169,4 @@ SmartRefreshControl.propTypes = { SmartRefreshControl.defaultProps={ overScrollBounce:false } -export default SmartRefreshControl; \ No newline at end of file +export default SmartRefreshControl; diff --git a/index.d.ts b/index.d.ts index dee1987..d68f974 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,4 +1,4 @@ -import react, { Component } from "react" +import React, { Component } from "react" import {ViewProps} from "react-native"; interface SmartRefreshLayoutProps extends ViewProps{ onRefresh?:()=>void,