You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The setNestedValue function operates on a shallow copy and not a deep copy of the functionInput. This is hiding that we mutate props, which is forbidden with React as you know.
I would do two things:
Call structuredClone on the obj in the setNestedValue to ensure we never mutate the object references.
Synchronously store the state of the form in a useState
The
setNestedValue
function operates on a shallow copy and not a deep copy of thefunctionInput
. This is hiding that we mutate props, which is forbidden with React as you know.I would do two things:
structuredClone
on the obj in thesetNestedValue
to ensure we never mutate the object references.useState
Video demo (open it): https://share.cleanshot.com/bJgJTBwD
The text was updated successfully, but these errors were encountered: