Hello team,
Another noob question
I am trying to understand how to correctly setup form values to reflect/sync any subsequent updates
Consider following scenario.
Form is created with initial data {firstname: John, lastName: Smith}, then as a result of another action, the same state is updated with new values {firstname: John, lastName: Smith}
I was trying to use second parameter in useForm to pass the values in. While it worked in applying the updates, whenever I try to update one filed in form by hand, any updates I made to the second filed reverted.
Attached demo demonstrates issue
When application starts, page data is set to {firstname: John, lastName: Smith}
After 5 seconds, it changes to {firstname: Scobby, lastName: Doo}
Open tina editor and change First Name to : Spider
Try changing Second Name to : Man
Observe First Name has changed back to Scobby
I also tried initialValues
to load initial state but didn’t find any way to apply subsequent updates. I am aware of loadInitialValues
, didn’t know how to use it to apply updates that could happen any time, for example as a result of another action
I am sure I am missing something fundamental and any help is much appreciated