Support custom ScrollView implementations in ListView

Summary: See e9f64b2f3f (commitcomment-16166567)

Reviewed By: tadeuzagallo

Differential Revision: D2953787

fb-gh-sync-id: b8978b3fa6ae9e848be918cc707335a06ea56cf6
shipit-source-id: b8978b3fa6ae9e848be918cc707335a06ea56cf6
This commit is contained in:
Nick Lockwood 2016-02-19 05:02:27 -08:00 committed by facebook-github-bot-5
parent 44ea74c2c7
commit b516976457
1 changed files with 6 additions and 2 deletions

View File

@ -231,14 +231,18 @@ var ListView = React.createClass({
/**
* Provides a handle to the underlying scroll responder.
* Note that the view in `SCROLLVIEW_REF` may not be a `ScrollView`, so we
* need to check that it responds to `getScrollResponder` before calling it.
*/
getScrollResponder: function() {
return this.refs[SCROLLVIEW_REF] &&
this.refs[SCROLLVIEW_REF].getScrollResponder &&
this.refs[SCROLLVIEW_REF].getScrollResponder();
},
scrollTo: function(...args) {
this.refs[SCROLLVIEW_REF] &&
this.refs[SCROLLVIEW_REF].scrollTo &&
this.refs[SCROLLVIEW_REF].scrollTo(...args);
},