Skip to content

Commit

Permalink
avoid children-field-name (PR from TinaCMS) (tinacms#2819)
Browse files Browse the repository at this point in the history
Co-authored-by: Jack Pettit <[email protected]>
Co-authored-by: tina-cloud-app[bot] <58178390+tina-cloud-app[bot]@users.noreply.github.com>
  • Loading branch information
tina-cloud-app[bot] and JackDevAU authored Jan 31, 2025
1 parent 32b1527 commit f7a8229
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion content/docs/reference/types/rich-text.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: The "rich-text" field
last_edited: '2024-12-31T02:27:57.931Z'
last_edited: '2025-01-31T03:03:00.095Z'
next: ''
previous: ''
---
Expand Down Expand Up @@ -330,6 +330,14 @@ e.g.
In the above example, if you failed to add the `Cta` *template* in your schema definition, the JSX element
will be treated as html

### Avoid Using "children" as a Field Name

When defining a `rich-text` field in TinaCMS, avoid using `"children"` as the field name. This can cause unexpected behavior due to potential conflicts with React's reserved prop names and the internal structure of TinaCMS.

#### Recommended Fix:

Instead of `"children"`, use a different name like `"body"` and include `isBody: true` (More details [here](https://tina.io/docs/reference/fields#isbody)) to get the same functionality as you would expect when using `"children"`.

## Other notes

### Full Spec
Expand Down

0 comments on commit f7a8229

Please sign in to comment.