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
I understand that this function attempts to update the keys in place if they are defined by the incoming updated value.
However, this kind of breaks setFieldValue in my opinion, where we need to override an entry in the array with the exact value required.
For example, if I had the shape as { a: string, b?: string, c?; string }
and I do form.setFieldValue('myArray', 0, { a: '123' });
I expected the first item in form.state.values.myArray to be exactly { a: '123' }
rather than { a: '123', b: 'previousBValue', c: 'previousCValue' }
Hello,
I understand that this function attempts to update the keys in place if they are defined by the incoming updated value.
However, this kind of breaks setFieldValue in my opinion, where we need to override an entry in the array with the exact value required.
For example, if I had the shape as
{ a: string, b?: string, c?; string }
and I do
form.setFieldValue('myArray', 0, { a: '123' });
I expected the first item in
form.state.values.myArray
to be exactly{ a: '123' }
rather than
{ a: '123', b: 'previousBValue', c: 'previousCValue' }
Particularly, lines 57-60.
form/packages/form-core/src/utils.ts
Lines 42 to 79 in 2bebfd5
Is this an intentional use case?
How do I unset the values of b and c in this situation then?
Haha also, please do put me in my place if I misunderstood anything. 🙏🏻
The text was updated successfully, but these errors were encountered: