Alessio Gravili
bffd98f019
feat(richtext-lexical): lexical => JSX converter (#8795)
Example:
```tsx
import React from 'react'
import {
type JSXConvertersFunction,
RichText,
} from '@payloadcms/richtext-lexical/react'
const jsxConverters: JSXConvertersFunction = ({ defaultConverters }) => ({
...defaultConverters,
blocks: {
// myTextBlock is the slug of the block
myTextBlock: ({ node }) => <div style={{ backgroundColor: 'red' }}>{node.fields.text}</div>,
},
})
export const MyComponent = ({ lexicalContent }) => {
return (
<RichText
converters={jsxConverters}
data={data.lexicalWithBlocks as SerializedEditorState}
/>
)
}
```
2024-11-26 22:40:24 +00:00
..
2024-11-19 08:52:50 -05:00
2024-11-11 13:59:05 -05:00
2024-06-17 14:25:36 -04:00
2024-06-17 14:25:36 -04:00
2024-11-11 13:59:05 -05:00
2024-06-24 16:38:46 -04:00
2024-11-21 14:16:01 -05:00
2024-11-11 13:59:05 -05:00
2024-11-11 13:59:05 -05:00
2024-09-28 17:33:50 +03:00
2024-10-17 02:05:27 +00:00
2024-11-12 09:26:04 +02:00
2024-11-26 22:40:24 +00:00
2024-11-21 20:14:57 +00:00
2024-11-20 13:03:35 -07:00
2024-08-29 21:25:50 -04:00
2024-10-18 03:22:05 +00:00
2024-08-29 21:25:50 -04:00
2024-11-11 13:59:05 -05:00
2024-11-11 13:59:05 -05:00
2024-06-17 14:25:36 -04:00
2024-11-11 13:59:05 -05:00
2024-11-12 05:07:50 +00:00
2024-09-09 20:01:49 +01:00
2024-10-16 21:52:48 -04:00
2024-11-25 10:28:07 -05:00
2024-06-17 14:25:36 -04:00
2024-11-11 13:59:05 -05:00
2024-11-11 13:59:05 -05:00
2024-11-11 13:59:05 -05:00
2024-06-17 14:25:36 -04:00
2024-08-21 20:44:04 -04:00
2024-08-21 20:44:04 -04:00
2024-08-21 20:44:04 -04:00
2024-11-11 13:59:05 -05:00
2024-11-11 13:59:05 -05:00