add setNativeProps to SectionList
Summary: ```js componentDidMount() { this._list.setNativeProps({scrollEnabled: false}) } render() { const sections = [ {key: 'foo', data: [{name: 'Jone Doe', key: 'a'}, {name: 'Susan Briz', key: 'b'}], {key: 'bar', data: [{name: 'David Mark', key: 'c'}, {name: 'Daniel Campbell', key: 'd'}] ] return ( <SectionList ref={c => (this._list = c)} sections={sections} renderItem={({item}) => <Text>{item.name}<Text>} /> ) } ``` Closes https://github.com/facebook/react-native/pull/15328 Differential Revision: D5546636 Pulled By: javache fbshipit-source-id: 25aec067879be1571db5c3a09b5f0952826220ac
This commit is contained in:
parent
36c694364f
commit
ccb0899658
|
@ -317,6 +317,13 @@ class SectionList<SectionT: SectionBase<any>> extends React.PureComponent<
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setNativeProps(props: Object) {
|
||||||
|
const listRef = this._wrapperListRef && this._wrapperListRef.getListRef();
|
||||||
|
if (listRef) {
|
||||||
|
listRef.setNativeProps(props);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const List = this.props.legacyImplementation
|
const List = this.props.legacyImplementation
|
||||||
? MetroListView
|
? MetroListView
|
||||||
|
|
Loading…
Reference in New Issue