Slide 39
Slide 39 text
{
"nodeType": "document"
,
"data": {}
,
"content":
[
{
"nodeType": "paragraph"
,
"data": {}
,
"content":
[
{
"nodeType": "text"
,
"value": "This text is "
,
"data": {}
,
"marks": [
]
}
,
{
"nodeType": "text"
,
"value": "important"
,
,
Rich Text is clean JSON!
const options = {
renderMark: {
[MARKS.BOLD]
:
text
= >
{text}
< /
Bold>,
},
renderNode: {
[BLOCKS.PARAGRAPH]
:
(node, children)
= >
{
return {children}
< /
Text>;
}
},
renderText: text
= >
text.replace('!', '?'),
};
documentToReactComponents(document, options);