Gutenberg: How to update the block and add new attributes without crashing it?

Created on 16 Aug 2018  路  1Comment  路  Source: WordPress/gutenberg

I had an issue with any block used already and saved in a page then I tried to update the block adding new attributes to it. when reloading this page, I found the block had crashed .. I know because the isValid function runs and checks the output after saving identical or not but that means that I can't update any block with any way. It should be more developer friendly. Is there any way to avoid this crash?

[Type] Help Request

Most helpful comment

You'll need to provide a deprecated version of your block; there is documentation on that here: https://github.com/WordPress/gutenberg/blob/master/docs/block-api/deprecated-blocks.md

Have a look through existing blocks in the blocks library: https://github.com/WordPress/gutenberg/tree/master/packages/block-library/src to see real-world examples 馃槃

>All comments

You'll need to provide a deprecated version of your block; there is documentation on that here: https://github.com/WordPress/gutenberg/blob/master/docs/block-api/deprecated-blocks.md

Have a look through existing blocks in the blocks library: https://github.com/WordPress/gutenberg/tree/master/packages/block-library/src to see real-world examples 馃槃

Was this page helpful?
0 / 5 - 0 ratings

Related issues

aaronjorbin picture aaronjorbin  路  3Comments

mhenrylucero picture mhenrylucero  路  3Comments

franz-josef-kaiser picture franz-josef-kaiser  路  3Comments

nylen picture nylen  路  3Comments

maddisondesigns picture maddisondesigns  路  3Comments