I often include a little demo of a custom block within the block editor, below the block definition. Thus I can always test if any changes I make to the definition code work out well. Ans if anyone else would like to use the custom block (e.g. as part of a library), the demo is part of the documentation, showing how to use it.
However something strange happens when I make a duplicate of the original block (right-click at the block; select "duplicate block definition"): the demo code with the original block's definition is now calling the duplicate block.
From https://forum.snap.berkeley.edu/t/demo-within-block-editor-is-affected-by-duplicate/16536:
I often include a little demo of a custom block within the block editor, below the block definition. Thus I can always test if any changes I make to the definition code work out well. Ans if anyone else would like to use the custom block (e.g. as part of a library), the demo is part of the documentation, showing how to use it.
However something strange happens when I make a duplicate of the original block (right-click at the block; select "duplicate block definition"): the demo code with the original block's definition is now calling the duplicate block.