mirror of
https://github.com/status-im/react-native.git
synced 2025-02-25 15:45:32 +00:00
Pass along scrollResponder()
Summary: Allows calls to `scrollResponder()` without crashing Reviewed By: fkgozali Differential Revision: D3293272 fbshipit-source-id: c46d99c0d7430a37fc364fa3aaf77dd192d7ab37
This commit is contained in:
parent
2c3ca4c058
commit
853074d1ee
@ -46,6 +46,8 @@ const SwipeableListView = React.createClass({
|
||||
},
|
||||
},
|
||||
|
||||
_listViewRef: (null: ?string),
|
||||
|
||||
propTypes: {
|
||||
dataSource: PropTypes.object.isRequired, // SwipeableListViewDataSource
|
||||
maxSwipeDistance: PropTypes.number,
|
||||
@ -79,12 +81,22 @@ const SwipeableListView = React.createClass({
|
||||
return (
|
||||
<ListView
|
||||
{...this.props}
|
||||
ref={(ref) => {
|
||||
this._listViewRef = ref;
|
||||
}}
|
||||
dataSource={this.state.dataSource}
|
||||
renderRow={this._renderRow}
|
||||
/>
|
||||
);
|
||||
},
|
||||
|
||||
// Passing through ListView's getScrollResponder() function
|
||||
getScrollResponder(): ?Object {
|
||||
if (this._listViewRef && this._listViewRef.getScrollResponder) {
|
||||
return this._listViewRef.getScrollResponder();
|
||||
}
|
||||
},
|
||||
|
||||
_renderRow(rowData: Object, sectionID: string, rowID: string): ReactElement {
|
||||
const slideoutView = this.props.renderQuickActions(rowData, sectionID, rowID);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user