-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Block editor: fix performance regression after #57950 #57971
Conversation
761ad1e
to
9306415
Compare
Size Change: +43 B (0%) Total Size: 1.7 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.
Makes sense!
Edit: maybe we should add a note for PrivateBlockContext
to discourage its usage in hooks besides useBlockProps
. Or something similar.
39778cb
to
c7a123d
Compare
It's fine depending on the situation, like if a component will anyway re-render. But it's marked private for a reason :p |
What?
I made a big performance regression in #57950. Probably because of using the private context, which changes on every render, which will cause even nested "pure" components to re-render. We should use the blockEdit context instead, which is memoized.
Why?
How?
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast