diff --git a/.changeset/nine-dolls-appear.md b/.changeset/nine-dolls-appear.md new file mode 100644 index 000000000..1b424c837 --- /dev/null +++ b/.changeset/nine-dolls-appear.md @@ -0,0 +1,6 @@ +--- +'@keystatic/core': patch +--- + +Fix warning from React about spreading `key` onto props when editing item in +array field diff --git a/packages/keystatic/src/form/fields/array/ui.tsx b/packages/keystatic/src/form/fields/array/ui.tsx index da84f9220..866f7f2af 100644 --- a/packages/keystatic/src/form/fields/array/ui.tsx +++ b/packages/keystatic/src/form/fields/array/ui.tsx @@ -257,6 +257,9 @@ function ArrayEditItemModalContent(props: { return { slugs, field: slugField, glob: '*' as const }; }, [props.previewProps, props.modalStateIndex]); + const { key, ...propsWithoutKey } = + props.previewProps.elements[props.modalStateIndex]; + return (