-
Notifications
You must be signed in to change notification settings - Fork 4.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
Export useResizeObserver
React Native version directly
#65588
Export useResizeObserver
React Native version directly
#65588
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Size Change: 0 B Total Size: 1.77 MB ℹ️ View Unchanged
|
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.
Thanks for fixing this 👍
Does this PR need to be backported to the release branch? |
I'm not sure how this stuff works exactly, but at the very least, there should be no risk of users introducing code that would be made obsolete at a later date/release by this PR's changes. Any users trying to use the wrong (web-exclusive) API in a React Native context will instantly get an error. That said, I miss the context and knowledge to be able to answer that question will full confidence. |
…ix/use-resize-observer-react-native-export
…ix/use-resize-observer-react-native-export
Flaky tests detected in 1ea1b33. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/11016529056
|
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.
Following up to share that this change looks sound to me. 👍🏻
There are no errors in the native mobile app without this change currently, as we do not utilize the new callback variant, but it feels worthwhile to guard against this with the merged changes. If someone attempted to use the callback variant, it would result in the following error in the native mobile editor.
ERROR ReferenceError: Property 'ResizeObserver' doesn't exist
Thank you for merging this change! 🙇🏻
What?
useResizeObserver
was recently revamped (see #64943). There were some concerns about the React Native version potentially breaking, this PR addresses that.Why?
React Native users could potentially run into a bug if they tried to use the updated version of the utility, since it depends on web-exclusive APIs like
ResizeObserver
.How?
Export legacy React Native version at the top-level, as discussed here: #65389 (comment)