Open sriechersrc opened 2 months ago
@sriechersrc did you try the HTML converter ? https://payloadcms.com/docs/beta/lexical/converters#lexical-html
@yobottehg yes, but I need to control how the html is rendered i.e. use react components. The html converter only spits out normal html if I understand correctly? In my case I need to "remap" the tags to their corresponding components in my code. For example an <a>
tag needs to be rendered as a NextJS <Link />
@sriechersrc The demo website repo contains a "serialize" function which seems to be the right approach if you want full control.
@AndKenneth thanks! This is exactly the solution I was looking for.
Documentation Issue
I cannot find any helpful information on how to render richtext the correct way in the frontend. I am running a next js application with payload v3. I am currently using this package to render the content but it isn't as customizable as I'd wish. Is there a more straight forward "payload native" way of doing this?