diff --git a/Libraries/Experimental/SwipeableRow/SwipeableRow.js b/Libraries/Experimental/SwipeableRow/SwipeableRow.js index fb9cc1df4..5e9e796cd 100644 --- a/Libraries/Experimental/SwipeableRow/SwipeableRow.js +++ b/Libraries/Experimental/SwipeableRow/SwipeableRow.js @@ -16,10 +16,6 @@ const PanResponder = require('PanResponder'); const React = require('React'); const PropTypes = require('prop-types'); const StyleSheet = require('StyleSheet'); -/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error - * found when Flow v0.54 was deployed. To see the error delete this comment and - * run Flow. */ -const TimerMixin = require('react-timer-mixin'); const View = require('View'); const createReactClass = require('create-react-class'); @@ -85,8 +81,7 @@ const SwipeableRow = createReactClass({ displayName: 'SwipeableRow', _panResponder: {}, _previousLeft: CLOSED_LEFT_POSITION, - - mixins: [TimerMixin], + _timeoutID: (null: ?TimeoutID), propTypes: { children: PropTypes.any, @@ -157,7 +152,7 @@ const SwipeableRow = createReactClass({ * Do the on mount bounce after a delay because if we animate when other * components are loading, the animation will be laggy */ - this.setTimeout(() => { + this._timeoutID = setTimeout(() => { this._animateBounceBack(ON_MOUNT_BOUNCE_DURATION); }, ON_MOUNT_BOUNCE_DELAY); } @@ -173,6 +168,12 @@ const SwipeableRow = createReactClass({ } }, + componentWillUnmount() { + if (this._timeoutID != null) { + clearTimeout(this._timeoutID); + } + }, + render(): React.Element { // The view hidden behind the main view let slideOutView;