Skip to content
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

[Performance] blockWidth in block and block-list-item #2962

Closed
dratwas opened this issue Jan 5, 2021 · 0 comments · Fixed by WordPress/gutenberg#28299 or WordPress/gutenberg#28635
Closed

Comments

@dratwas
Copy link
Contributor

dratwas commented Jan 5, 2021

I checked the blockWidth that is set in the state of each block and seems like this is the same for most of the blocks. The blockWidth is different only for nested blocks like Column, Button etc. I’m wondering if we could measure the width at the top and then pass it to the bottom by a prop. Then set the passed value from props as a default value in state and set the width one more time only if the value in onLayout is different. I also found that we do the same inside the block.native.js which is a child of block-list-item.

Please check block.native.js and block-list-item.native.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment