-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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 ScrollView getInnerViewNode and getInnerViewRef ref methods #30588
Conversation
Hi @vshab! Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks! |
Base commit: 2a175b1 |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
The other methods aren't bound either are they? Is the behavior of this method inconsistent with the behavior of the other methods? The functions on refs in React Native are pretty much all not bound to avoid creating new functions or breaking referential equality on every render |
@TheSavior
Other methods are bound because they are defined as arrow function class properties. See https://github.com/facebook/react-native/blob/master/Libraries/Components/ScrollView/ScrollView.js#L802 for example
Yes. Currently
As I said before all other methods are arrow function preserving |
Should the fix be to make these functions arrow functions as well instead of |
If you say so :) |
@TheSavior I replaced |
@TheSavior Hello! Anything else should be done to merge it? |
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.
@kacieb has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Summary
Currently ScrollView ref's
getInnerViewNode
andgetInnerViewRef
are unbound and don't work as expected returning empty values. The origin of this problem probably is issued by d2f314aWorking example of the problem is available here: https://github.com/vshab/RNGetInnerViewBug
This PR binds getInnerViewNode and getInnerViewRef to ScrollView and adds test checking the value of getInnerViewRef.
Before:
After:
Changelog
[JavaScript] [Fixed] - ScrollView: Fix
getInnerViewNode
andgetInnerViewRef
ref methodsTest Plan