-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Inserter: Fix InserterListbox rendering for React 19
#71410
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
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: +19 B (0%) Total Size: 1.92 MB
ℹ️ View Unchanged
|
Mamaduka
left a comment
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, @tyxla! I've not noticed any issues when testing locally.
We're creating a component to receive the ref, since Fragment can't receive refs and React will throw an error.
This might change in the future - facebook/react#32465.
Yeah, however, it's necessary for the time being. Luckily, it's a pretty cheap one. |
|
@Mamaduka mind if I ship with the e2e failures? It's the one that fails in every other PR and is not related. |
|
Yes, let's merge this. The e2e failures aren't related, I'm trying to debug those separately, but no luck so far :/ |
What?
This PR fixes an error during
InserterListboxrendering when using React 19.Why?
To prepare for React 19 compatibility and to fix an error when using React 19.
See #71336 for the full effort.
See #61521 for the PR where the changes came from.
How?
We're creating a component to receive the ref, since
Fragmentcan't receive refs and React will throw an error.The change is harmless and won't have any effect in React 18 since the error will be thrown only with React 19.
We're pulling in a part of #61521 to be landed separately.
Testing Instructions
To actually witness the error in React 19:
git revert a72061d862c923d5339c14f5a2ebf77a2441db02and go through the above testing instructions.Testing Instructions for Keyboard
None
Screenshots or screencast