-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Uncaught TypeError: _this.refs.scrollView.scrollTo is not a function
#539
Conversation
@flyskywhy Can you describe more what you intend to with this PR ? |
@@ -432,7 +432,7 @@ export default class extends Component { | |||
}) | |||
|
|||
// trigger onScrollEnd manually in android | |||
if (!animated || Platform.OS === 'android') { | |||
if (!animated || Platform.OS !== 'ios') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why changing this line ?
@@ -419,10 +419,10 @@ export default class extends Component { | |||
if (state.dir === 'x') x = diff * state.width | |||
if (state.dir === 'y') y = diff * state.height | |||
|
|||
if (Platform.OS === 'android') { | |||
this.refs.scrollView && this.refs.scrollView[animated ? 'setPage' : 'setPageWithoutAnimation'](diff) | |||
if (Platform.OS !== 'ios') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why changing this line ?
The reason of changing |
when using https://github.com/flyskywhy/react-web
ref to https://facebook.github.io/react/docs/refs-and-the-dom.html