Skip to content

Commit e8a5477

Browse files
committed
README
1 parent 44b49e5 commit e8a5477

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

docs/structured-text.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ const Page = ({ data }) => {
121121
// ]
122122
// },
123123
// { type: "span", value: " in our team! We call him " },
124-
// { type: "block", item: "1984560" }
124+
// { type: "inlineBlock", item: "1984560" }
125125
// ]
126126
// },
127127
// { type: "block", item: "1984559" }
@@ -259,7 +259,7 @@ export default withQuery(query)(Page);
259259

260260
## Override default rendering of nodes
261261

262-
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:
263263

264264
For example:
265265

@@ -338,18 +338,18 @@ import SyntaxHighlight from 'components/SyntaxHighlight';
338338
/>;
339339
```
340340

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!
342342

343343
## Props
344344

345-
| prop | type | required | description | default |
346-
| ------------------ | --------------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------- |
347-
| 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` |
345+
| prop | type | required | description | default |
346+
| ------------------ | --------------------------------------------------------------- | ------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------- |
347+
| 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

Comments
 (0)