diff --git a/.changeset/cool-books-relax.md b/.changeset/cool-books-relax.md new file mode 100644 index 0000000..258cf6b --- /dev/null +++ b/.changeset/cool-books-relax.md @@ -0,0 +1,5 @@ +--- +'@graphcms/rich-text-react-renderer': patch +--- + +Use index as key on line break to fix React warning of same keys diff --git a/packages/react-renderer/src/RenderText.tsx b/packages/react-renderer/src/RenderText.tsx index 19a7c4d..0e22dd6 100644 --- a/packages/react-renderer/src/RenderText.tsx +++ b/packages/react-renderer/src/RenderText.tsx @@ -8,7 +8,7 @@ function serialize(text: string) { const splitText = text.split('\n'); return splitText.map((line, index) => ( - + {line} {index === splitText.length - 1 ? null :
}