This package allows you to convert Wordpress Gutenbergs post_content field on the post object to a ReactJs tree.
Madness.
npm install @threemammals/gutenberg-to-react
const { gutenbergToReact } = require('@threemammals/gutenberg-to-react');
// example of Wordpress Gutenberg post_content from the post object
const input = '<!-- wp:paragraph -->\n<p>text <br></p>\n<!-- /wp:paragraph -->';
// parse to ReactJs tree
const result = gutenbergToReact(input);
// check out your ReactJs tree?!?!?
console.log(result);
[
{
type: 'core/paragraph',
ref: null,
'$$typeof': Symbol(react.element),
props: { style: {}, className: null, children: [Array] }
}
]