How can I make Gutenberg block layout switchable without lost of current content?

I’m relativ new to WordPress and Gutenberg development. Now I have a requirement where I want feature where I can switch from three different layouts. I built a Gutenberg plugin where I can switch between three templates. To switch my current block layout I use the function resetBlocks.

Actually it’s fit the requirement, but the problem that occurs is, that when an editor start to write some content and switch to a different layout, all the current content is lost.

How can I change the current block arrangement without losing the content?`

Topic block-editor screen-layout Wordpress

Category Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.