Skip to content
This repository has been archived by the owner on Jul 28, 2023. It is now read-only.

Inner block duplication on initially shown inner blocks #29

Closed
luisherranz opened this issue May 25, 2022 · 1 comment
Closed

Inner block duplication on initially shown inner blocks #29

luisherranz opened this issue May 25, 2022 · 1 comment
Labels
wontfix This will not be worked on

Comments

@luisherranz
Copy link
Member

There's a problem with the user-land implementation of <template> done in #8 to support initially hidden inner blocks, and exacerbated in #26 to render multiple inner blocks in the save wrapper, which duplicates the inner blocks once you refresh the page in the Editor if the inner blocks are initially shown:

Screen.Capture.on.2022-05-25.at.15-00-18.mp4

There's no point in fixing this because Gutenberg won't render the inner blocks more than once if/when we propose this.

I'm not sure if we should leave it like this or revert #26.

This only happens if the inner blocks are initially shown, so to prevent this issue keep them initially hidden, like this:

const Frontend = ( { blockProps, attributes, children } ) => {
	const [ show, setShow ] = useState( false );
@luisherranz
Copy link
Member Author

Closed as we're not actively working on this experiment anymore and this works fine in the Directives Hydration.

@luisherranz luisherranz closed this as not planned Won't fix, can't repro, duplicate, stale Jan 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

1 participant