import PrismicRichText from 'prismic-richtext';
PrismicRichText.asTree(doc.data.myRichText)
You can find an example here: https://github.com/prismicio/prismic-dom/blob/master/src/index.js
import PrismicRichText from 'prismic-richtext';
// define a serialize function to manage your fragment
// you can use the 'Element' Helper from PrismicRichText to match the different fragments
function serialize() {...}
PrismicRichText.serialize(doc.data.myRichText, serialize, htmlSerializer)