From f7a82296249169240d1813507b05f19ae68127ed Mon Sep 17 00:00:00 2001 From: "tina-cloud-app[bot]" <58178390+tina-cloud-app[bot]@users.noreply.github.com> Date: Fri, 31 Jan 2025 14:23:13 +1100 Subject: [PATCH] avoid children-field-name (PR from TinaCMS) (#2819) Co-authored-by: Jack Pettit Co-authored-by: tina-cloud-app[bot] <58178390+tina-cloud-app[bot]@users.noreply.github.com> --- content/docs/reference/types/rich-text.mdx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/content/docs/reference/types/rich-text.mdx b/content/docs/reference/types/rich-text.mdx index 73c2eef1b..1ab76e249 100644 --- a/content/docs/reference/types/rich-text.mdx +++ b/content/docs/reference/types/rich-text.mdx @@ -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: '' --- @@ -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