-
Notifications
You must be signed in to change notification settings - Fork 4.5k
BrowserURL: Refactor to a function component and use hooks #71035
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: -113 B (-0.01%) Total Size: 1.91 MB
ℹ️ View Unchanged
|
Flaky tests detected in 5c9b477. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/16704000000
|
I just realized there's a similar PR by @R1shabh-Gupta. Considering this also refactors away from |
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 the PR!
It works fine, but one concern is that the replaceState
is executed on the first render, even though it already has the post ID:
b9ddfd8a5760ac1cab712f05d73f0b95.mp4
I don't think this will cause any problems, but do you think this needs to be resolved? My understanding is that this is related th the differencer in behaviour between class components and function components.
@t-hamano, yes, that's the difference between effect and lifecycle methods, which I don't think is a problem here. The main requirement is that client/server generated URLs should match, and they do. |
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.
I see, thanks for the explanation!
What?
Supersedes #70395.
PR refactors
BrowserURL
into a function component and replaces data HOCs with hooks.Why?
Just a minor code quality improvement.
Testing Instructions
Testing Instructions for Keyboard
Same.