You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This component automatically renders all nodes (except for `inline_item`, `item_link`, `block` and `inline_block`) using a set of default rules, but you might want to customize those. For example:
262
+
This component automatically renders all nodes (except for `inlineItem`, `itemLink`, `block` and `inlineBlock`) using a set of default rules, but you might want to customize those. For example:
263
263
264
264
For example:
265
265
@@ -338,18 +338,18 @@ import SyntaxHighlight from 'components/SyntaxHighlight';
338
338
/>;
339
339
```
340
340
341
-
Note: if you override the rules for `inline_item`, `item_link`, `block` or `inline_block` nodes, then the `renderInlineRecord`, `renderLinkToRecord`, `renderBlock` and `renderInlineBlock` props won't be considered!
341
+
Note: if you override the rules for `inlineItem`, `itemLink`, `block` or `inlineBlock` nodes, then the `renderInlineRecord`, `renderLinkToRecord`, `renderBlock` and `renderInlineBlock` props won't be considered!
| data |`StructuredTextGraphQlResponse \| DastNode`|:white_check_mark:| The actual [field value](https://www.datocms.com/docs/structured-text/dast) you get from DatoCMS ||
348
-
| renderInlineRecord |`({ record }) => ReactElement \| null`| Only required if document contains `inline_item` nodes | Convert an `inline_item` DAST node into React |`[]`|
349
-
| renderLinkToRecord |`({ record, children }) => ReactElement \| null`| Only required if document contains `item_link` nodes | Convert an `item_link` DAST node into React |`null`|
350
-
| renderBlock |`({ record }) => ReactElement \| null`| Only required if document contains `block` nodes | Convert a `block` DAST node into React |`null`|
351
-
| renderInlineBlock |`({ record }) => ReactElement \| null`| Only required if document contains `inline_block` nodes | Convert an `inline_block` DAST node into React |`null`|
352
-
| metaTransformer |`({ node, meta }) => Object \| null`|:x:| Transform `link` and `itemLink` meta property into HTML props |[See function](https://github.com/datocms/structured-text/blob/main/packages/generic-html-renderer/src/index.ts#L61)|
353
-
| customNodeRules |`Array<RenderRule>`|:x:| Customize how nodes are converted in JSX (use `renderNodeRule()` to generate rules) |`null`|
354
-
| customMarkRules |`Array<RenderMarkRule>`|:x:| Customize how marks are converted in JSX (use `renderMarkRule()` to generate rules) |`null`|
355
-
| renderText |`(text: string, key: string) => ReactElement \| string \| null`|:x:| Convert a simple string text into React |`(text) => text`|
| data |`StructuredTextGraphQlResponse \| DastNode`|:white_check_mark:| The actual [field value](https://www.datocms.com/docs/structured-text/dast) you get from DatoCMS ||
348
+
| renderInlineRecord |`({ record }) => ReactElement \| null`| Only required if document contains `inlineItem` nodes | Convert an `inlineItem` DAST node into React|`[]`|
349
+
| renderLinkToRecord |`({ record, children }) => ReactElement \| null`| Only required if document contains `itemLink` nodes | Convert an `itemLink` DAST node into React|`null`|
350
+
| renderBlock |`({ record }) => ReactElement \| null`| Only required if document contains `block` nodes | Convert a `block` DAST node into React |`null`|
351
+
| renderInlineBlock |`({ record }) => ReactElement \| null`| Only required if document contains `inlineBlock` nodes | Convert an `inlineBlock` DAST node into React|`null`|
352
+
| metaTransformer |`({ node, meta }) => Object \| null`|:x:| Transform `link` and `itemLink` meta property into HTML props |[See function](https://github.com/datocms/structured-text/blob/main/packages/generic-html-renderer/src/index.ts#L61)|
353
+
| customNodeRules |`Array<RenderRule>`|:x:| Customize how nodes are converted in JSX (use `renderNodeRule()` to generate rules) |`null`|
354
+
| customMarkRules |`Array<RenderMarkRule>`|:x:| Customize how marks are converted in JSX (use `renderMarkRule()` to generate rules) |`null`|
355
+
| renderText |`(text: string, key: string) => ReactElement \| string \| null`|:x:| Convert a simple string text into React |`(text) => text`|
0 commit comments