Setting/unsetting alignment causes Edit component to unmount/mount #35949
Labels
[Feature] Block API
API that allows to express the block paradigm.
[Type] Bug
An existing feature does not function as intended
Description
When you change a block alignment from none to something else or the reverse, the Edit function gets unmounted and mounted again. This causes any state/refs/effects on the function to get lost.
Step-by-step reproduction instructions
I can't think of any core block that has both alignment and uses user-controllred state so I tested in two ways:
HTML block
Any other block with alignment option.
Edit
component:Screenshots, screen recording, code snippet
switching.mov
cart-block.mov
Environment info
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: