When using the RichText component imported from
@payloadcms/richtext-lexical/react, how do you customize the standard nodes that have children? Before, in the
serialize.tsxfile, you had functions that provided
serializedChilden<p className='col-start-2 mb-4' key={index}>
{serializedChildren}
</p>But how would you add the children in this instance?
What I currently have:
const jsxConverters: JSXConvertersFunction = ({ defaultConverters }) => ({
...defaultConverters,
paragraph: ({ node }) => {
return <p>{whatGoesHere?}</p>;
},
blocks: {
accordion: ({ node }) => (
<Accordion {...(node.fields as AccordionProps)} />
)
}
});const text = nodesToJSX({ nodes: node.children }).join("");where does
nodesToJSX()come from?
nvm, I found it. Thank you very much.
Star
Discord
online
Get dedicated engineering support directly from the Payload team.