RN: Add `close` to SwipeableRow

Reviewed By: sahrens

Differential Revision: D5365597

fbshipit-source-id: 18cc896b551ce11b64c85067d5f17b3614762814
This commit is contained in:
Tim Yung 2017-07-03 19:03:21 -07:00 committed by Facebook Github Bot
parent 6312d67bcb
commit c28595e3fb
1 changed files with 6 additions and 0 deletions

View File

@ -190,6 +190,11 @@ const SwipeableRow = React.createClass({
);
},
close(): void {
this.props.onClose();
this._animateToClosedPosition();
},
_onSwipeableViewLayout(event: Object): void {
this.setState({
isSwipeableViewRendered: true,
@ -268,6 +273,7 @@ const SwipeableRow = React.createClass({
{
duration,
toValue,
useNativeDriver: true,
},
).start(() => {
this._previousLeft = toValue;