mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-05-21 05:55:48 +00:00
[fix] how ListView uses ScrollView
* Bind `_setScrollViewRef` to instance * Fix getting ScrollView props for ListView
This commit is contained in:
committed by
Nicolas Gallagher
parent
d64df129b2
commit
0c76cc5d80
@@ -6,6 +6,8 @@ import ScrollView from '../ScrollView';
|
||||
import View from '../View';
|
||||
import React, { Component } from 'react';
|
||||
|
||||
const scrollViewProps = Object.keys(ScrollView.propTypes);
|
||||
|
||||
class ListView extends Component {
|
||||
static propTypes = ListViewPropTypes;
|
||||
|
||||
@@ -88,14 +90,14 @@ class ListView extends Component {
|
||||
}
|
||||
}
|
||||
|
||||
const props = pick(ScrollView.propTypes, this.props);
|
||||
const props = pick(this.props, scrollViewProps);
|
||||
|
||||
return React.cloneElement(this.props.renderScrollComponent(props), {
|
||||
ref: this._setScrollViewRef
|
||||
}, header, children, footer);
|
||||
}
|
||||
|
||||
_setScrollViewRef(component) {
|
||||
_setScrollViewRef = (component) => {
|
||||
this._scrollViewRef = component;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user