Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(form): avoid spreading key prop #6776

Merged
merged 1 commit into from
May 29, 2024
Merged

Conversation

christianhg
Copy link
Contributor

Description

Before this change, React would throw a runtime error stating that A props object containing a "key" prop is being spread into JSX. Now, the key is passed to the JSX without using spread.

What to review

To test this you can run pnpm dev to spin up the test studio, and then open a document that has an array of objects. Verify that the error is gone.

Screenshot 2024-05-28 at 13 00 03

Testing

Not practical to write an automated test for since it's a mitigation of a React render error.

Notes for release

Before this change, React would throw a runtime error stating that `A props
object containing a "key" prop is being spread into JSX`. Now, the `key` is
passed to the JSX without using spread.
@christianhg christianhg requested a review from a team as a code owner May 28, 2024 11:01
@christianhg christianhg requested review from bjoerge and removed request for a team May 28, 2024 11:01
Copy link

vercel bot commented May 28, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
page-building-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 28, 2024 11:03am
performance-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 28, 2024 11:03am
test-next-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 28, 2024 11:03am
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 28, 2024 11:03am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) May 28, 2024 11:03am

Copy link
Contributor

No changes to documentation

Copy link
Contributor

Component Testing Report Updated May 28, 2024 11:09 AM (UTC)

File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 36s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 7s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 27s 6 0 0
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 31s 11 7 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 14s 6 0 0
formBuilder/inputs/PortableText/DisableFocusAndUnset.spec.tsx ✅ Passed (Inspect) 9s 3 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 37s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 1m 15s 21 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 1m 4s 18 0 0
formBuilder/inputs/PortableText/PresenceCursors.spec.tsx ✅ Passed (Inspect) 7s 3 9 0
formBuilder/inputs/PortableText/RangeDecoration.spec.tsx ✅ Passed (Inspect) 22s 9 0 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 15s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ✅ Passed (Inspect) 30s 12 0 0

Copy link
Member

@bjoerge bjoerge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @christianhg!

@bjoerge bjoerge added this pull request to the merge queue May 29, 2024
Merged via the queue into next with commit eeba7f2 May 29, 2024
40 of 41 checks passed
@bjoerge bjoerge deleted the fix-form-avoid-spreading-key branch May 29, 2024 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants