-
Notifications
You must be signed in to change notification settings - Fork 47.5k
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
ReactNative's ref.measureLayout now takes a ref #15126
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Lets not change NativeMethodsMixin or ReactNative.NativeComponent. Let's not make those more powerful now. |
Details of bundled changes.Comparing: 103378b...36ded07 react-native-renderer
Generated by 🚫 dangerJS |
bvaughn
approved these changes
Mar 29, 2019
uiViewClassName: 'RCTView', | ||
})); | ||
|
||
[View].forEach(Component => { |
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.
😆
elicwhite
added a commit
to elicwhite/react
that referenced
this pull request
Apr 4, 2019
The Fabric renderer was previously calling the paper UIManager's measure calls and passing the react tag. This PR changes the renderer to now call FabricUIManager passing the node instead. One of the parts of this that feels more controversial is making NativeMethodsMixin and ReactNative.NativeComponent warn when calling measureLayout in Fabric. As Seb and I decided in facebook#15126, it doesn't make sense for a component created with one of these methods to require a native ref but not work the other way around. For example: a.measureLayout(b) might work but b.measureLayout(a) wouldn't. We figure we should keep these consistent and continue migrating things off of NativeMethodsMixin and NativeComponent. If this becomes problematic for the Fabric rollout then we should revisit this.
elicwhite
added a commit
that referenced
this pull request
Apr 9, 2019
* [React Native] Add tests to paper renderer for measure, measureLayout * [React Native] measure calls will now call FabricUIManager The Fabric renderer was previously calling the paper UIManager's measure calls and passing the react tag. This PR changes the renderer to now call FabricUIManager passing the node instead. One of the parts of this that feels more controversial is making NativeMethodsMixin and ReactNative.NativeComponent warn when calling measureLayout in Fabric. As Seb and I decided in #15126, it doesn't make sense for a component created with one of these methods to require a native ref but not work the other way around. For example: a.measureLayout(b) might work but b.measureLayout(a) wouldn't. We figure we should keep these consistent and continue migrating things off of NativeMethodsMixin and NativeComponent. If this becomes problematic for the Fabric rollout then we should revisit this. * Fixing Flow * Add FabricUIManager to externals for paper renderer * import * as FabricUIManager from 'FabricUIManager'; * Update tests * Shouldn't have removed UIManager import * Update with the new tests
This was referenced Jul 21, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The number is the reactTag which is found in product code with
findNodeHandle
. In order to get rid offindNodeHandle
this needs to be able to be called with a ref. This PR now allows measureLayout to be passed a ref which must be a ref to a native node.In Paper we will get the nativeTag for this ref, in Fabric, in a follow up, this will pull the node off the ref.canonical and call FabricUIManger with it.