Change classname in Block Editor save function after compile #57561
-
Hi, I have a question about Gutenberg Block’s save function. I am currently developing custom Gutenberg blocks using @wordpress/scripts + tailwind. Since I am using tailwind, I use many utility classes on both edit and save function. For example: Snippet from
Snippet from
Here is my question. Let’s say that I added a registered custom block on the page and saved on my local setup. While I am running npm run start and changing/adding/removing the class name from the Save.js, I noticed that the block that I created is no longer valid with following message Is there a way to avoid this issue? Any assistance would be greatly appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @jkang-moneyjet,
Basically, if you update the markup that is saved, i.e. the save.js function, you will need block deprecation to migrate to the new markup without breaking the block. Below are the relevant documents. |
Beta Was this translation helpful? Give feedback.
Hi @jkang-moneyjet,
Basically, if you update the markup that is saved, i.e. the save.js function, you will need block deprecation to migrate to the new markup without breaking the block. Below are the relevant documents.