Skip to content

I would like to overwrite some elements with @payloadcms/richtext-lexical/react #9951

Answered by sznski
sznski asked this question in Q&A
Discussion options

You must be logged in to vote

I found a way to solve this (though I'm not sure if it's the best approach, it works well for me).

For anyone struggling with custom Lexical features, there is a helpful guide. It would be great if Payload could include my example in the documentation, as selecting and modifying nodes is a common use case I think so.

If anyone has a better solution, I'd appreciate it if you could share your code

strong rich text serializing and custom feature


import React from 'react'
import {
  JSXConverters,
  type JSXConvertersFunction,
  RichText as PayloadRichText,
} from '@payloadcms/richtext-lexical/react'
import type { SerializedEditorState } from '@payloadcms/richtext-lexical/lexical'
import { cn }

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by sznski
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant