Open JacobGalati opened 3 years ago
To clarify this obviously is only an issue in development since strict mode has no effect on production.
Hey, @JacobGalati. I recommend putting your use case in an isolated reproduction. That may help you spot the issues.
I don't think React's strict mode has anything to do with the error (but it may). Perhaps you're indeed registering (rendering) two fields with the same name?
Hey @kettanaito if you take a look at my sandbox I linked at the bottom of the issue you can see the errors. Commenting out
Thanks for providing the sandbox, @JacobGalati!
I don't have time capacity to maintain this library right now, so feel free to investigate on your own. I can dedicate some time to do a code review and merge the fix, but I wouldn't count on anything else.
Environment
What
When running a create-react-app with React.StrictMode (the default for React 17) an
Uncaught Invariant Viloation
error is thrown for all form fields.Current behavior
An error is thrown for the first form field and the field does not function. Example:
Expected behavior
No error would be thrown and the field would function as expected.
Why
I think it is because strict mode renders components twice to detect code issues as mentioned here
How
Steps to reproduce the issue (ideally, link to the repository/sandbox). Here is a Sandbox of the error.