Updated ListView.scrollTo() API to match ScrollView

Reviewed By: davidaurelio

Differential Revision: D2895460

fb-gh-sync-id: 0520df3f2ed6614a08e3fc20a2417c7a8e2ace68
This commit is contained in:
Nick Lockwood
2016-02-03 09:16:15 -08:00
committed by facebook-github-bot-6
parent e6cb02d61a
commit e9f64b2f3f

View File

@@ -227,17 +227,14 @@ var ListView = React.createClass({
},
/**
* Provides a handle to the underlying scroll responder to support operations
* such as scrollTo.
* Provides a handle to the underlying scroll responder.
*/
getScrollResponder: function() {
return this.refs[SCROLLVIEW_REF] &&
this.refs[SCROLLVIEW_REF].getScrollResponder &&
this.refs[SCROLLVIEW_REF].getScrollResponder();
return this.refs[SCROLLVIEW_REF].getScrollResponder();
},
scrollTo: function(destY, destX, animated = true) {
this.getScrollResponder().scrollResponderScrollTo(destX || 0, destY || 0, animated);
scrollTo: function(...args) {
this.refs[SCROLLVIEW_REF].scrollTo(...args);
},
setNativeProps: function(props) {