Replies: 2 comments 2 replies
-
useForm hook is designed to hold regular js values (numbers, strings, objects, arrays, etc.). It cannot process correctly values that cannot be processed as json or values that have been modified on object level with something like |
Beta Was this translation helpful? Give feedback.
0 replies
-
I am having the same issue. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a form set by Mantine useForm. Nothing special. I then set the form value to the context because I need to use it on multiple "pages" - tabs, but visually it separated forms. From code perspective it is one data object. I am setting the form without initial values as they are fetched later on, so in useEffect I then initialize the form with form.initialize(client); when I do have the client data.
But I have massive problem with Cannot assign to read only property 'name' of object '#'. Interestingly when I try to input something in an number input or boolean, it somehow "start" the form and then also text inputs for name etc. are working correctly and data is updated. Boolean (checkbox) shows the error, but on the second check/uncheck it is working normally. Weird. Number input do not returns any error. Just works and then the whole form is working.
This "edit" mode is visible after button click, but the form is initialized right away as form values are also used to display data in preview mode. The data is there and is showing correctly.
After adding the form.initialize(client) part, the base form is working on first go - go to page, click edit button, form is working. But after submit or dismiss changes and going back to edit mode then, form is not working again. Forms on the other tabs are not working never.
I was trying controlled and uncontrolled form mode, no change. I can't share the code with you as it is not allowed by my company, so my question is more like if someone more experienced have some experience with this behaviour or will have any suggestions what to try.
Full error here:
The error itself is fired by code in setPath
->cloned[splittedPath[0]] = value;
The form was working previously, but I just can't find the thing what broke it. There was few unrelated changes to the code around, but nothing what should broke it (and I tried to go one by one on/off and didn't find it..)
Beta Was this translation helpful? Give feedback.
All reactions