Pass block attributes without rerending tree
-
Hey, we’re building out some pretty advanced blocks for Gutenberg which involves the editor block having many child components. We’re noticing that currently it seems the only way for child components to get the block attributes is to pass down the attributes as a prop. However this means that if any attribute is updated, the entire tree is re-rendered. Is there a better way for child components to directly access and update relevant block attributes? Trying to avoid overriding
shouldComponentUpdate
for every child component (there’s like 16+)Normally with redux applications this is avoided since every component has access to the global state, so you don’t need to pass props down the entire tree. Since Gutenberg relies on redux, is there a way to get and update a blocks attributes directly with the underlying redux store?
Thanks.
- The topic ‘Pass block attributes without rerending tree’ is closed to new replies.