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
This commit is contained in:
陈三 2016-07-05 12:56:47 -07:00 committed by Facebook Github Bot 7
parent f49cc6e2f1
commit 3b9872265c
1 changed files with 1 additions and 1 deletions

View File

@ -75,7 +75,7 @@ const SwipeableListView = React.createClass({
*/ */
dataSource: PropTypes.instanceOf(SwipeableListViewDataSource).isRequired, dataSource: PropTypes.instanceOf(SwipeableListViewDataSource).isRequired,
// Maximum distance to open to after a swipe // Maximum distance to open to after a swipe
maxSwipeDistance: PropTypes.number, maxSwipeDistance: PropTypes.number.isRequired,
// Callback method to render the swipeable view // Callback method to render the swipeable view
renderRow: PropTypes.func.isRequired, renderRow: PropTypes.func.isRequired,
// Callback method to render the view that will be unveiled on swipe // Callback method to render the view that will be unveiled on swipe