Delegate a couple ListView methods

This commit is contained in:
Scott Kyle 2016-01-21 11:40:20 -08:00
parent 5772717dee
commit 7f25ed7897

View File

@ -154,7 +154,9 @@ class ListView extends React.Component {
}
render() {
return <React.ListView {...this.props} renderRow={this.renderRow} />;
return (
<React.ListView {...this.props} ref="listView" renderRow={this.renderRow} />
);
}
renderRow(_, sectionId, rowId, ...args) {
@ -164,6 +166,14 @@ class ListView extends React.Component {
// The item could be null because our data is a snapshot and it was deleted.
return item ? props.renderRow(item, sectionId, rowId, ...args) : null;
}
scrollTo(x, y, ...extra) {
this.refs.listView.scrollTo(x, y, ...extra);
}
setNativeProps(props) {
this.refs.listView.setNativeProps(props);
}
}
ListView.propTypes = {