Skip to content

Commit 24da30a

Browse files
authored
docs: add inlineBlock converter example to the converters configuration in Converters.mdx (#11158)
### What? Added a quick example to showcase how to add a converter for inlineBlocks. ### Why? This is not easy to figure out in the current version. As per [Discord discussion](https://discord.com/channels/967097582721572934/1338624577990823997) ### How? Added a very basic 3 lines example to keep the file simple.
1 parent 4be410c commit 24da30a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

docs/rich-text/converters.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ const jsxConverters: JSXConvertersFunction = ({ defaultConverters }) => ({
5151
// myTextBlock is the slug of the block
5252
myTextBlock: ({ node }) => <div style={{ backgroundColor: 'red' }}>{node.fields.text}</div>,
5353
},
54+
inlineBlocks: {
55+
// myInlineBlock is the slug of the block
56+
myInlineBlock: ({ node }) => <span>{node.fields.text}</span>,
57+
},
5458
})
5559

5660
export const MyComponent = ({ lexicalData }) => {

0 commit comments

Comments
 (0)