From 3b9872265c7c07d5ba4d4e90720c72849a2b0bc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E4=B8=89?= Date: Tue, 5 Jul 2016 12:56:47 -0700 Subject: [PATCH] fix required propType. Summary: The required `maxSwipeDistance` was already defined in https://github.com/facebook/react-native/blob/master/Libraries/Experimental/SwipeableRow/SwipeableRow.js#L83, but the default value is [`0`](https://github.com/facebook/react-native/blob/master/Libraries/Experimental/SwipeableRow/SwipeableRow.js#L118), that means it just doesn't work by default. I think it's much clearer to make it required on `SwipeableListView`. Or specify a default value larger that 0. Closes https://github.com/facebook/react-native/pull/8466 Differential Revision: D3518167 fbshipit-source-id: a342bbb94da19bd621c8f9458896a232be8db38d --- Libraries/Experimental/SwipeableRow/SwipeableListView.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/Experimental/SwipeableRow/SwipeableListView.js b/Libraries/Experimental/SwipeableRow/SwipeableListView.js index ea0e5e222..f18d240b1 100644 --- a/Libraries/Experimental/SwipeableRow/SwipeableListView.js +++ b/Libraries/Experimental/SwipeableRow/SwipeableListView.js @@ -75,7 +75,7 @@ const SwipeableListView = React.createClass({ */ dataSource: PropTypes.instanceOf(SwipeableListViewDataSource).isRequired, // Maximum distance to open to after a swipe - maxSwipeDistance: PropTypes.number, + maxSwipeDistance: PropTypes.number.isRequired, // Callback method to render the swipeable view renderRow: PropTypes.func.isRequired, // Callback method to render the view that will be unveiled on swipe