Closed cohenrobinson closed 5 months ago
Hi @cohenrobinson,
there is a similar issue https://github.com/vazco/uniforms/issues/1194#issuecomment-1784641342.
Could you have a look at it and tell me if it helps in any way?
Try disabling strict mode
.
Related: #1324
Closing due to no response. It will be fixed in #1324.
Hello!
I just migrated from using the standard CRA installation to now using React + Next.js. Unsure if the following is a bug with Next.js (14.1.4) or uniforms (4.0.0-alpha.5)
After migrating, all uniforms AutoForms I implemented would now not have the AutoField state updated, even though they were previously working.
I implemented a very straightforward AutoForm per the docs just to see if it was an issue with my custom implementation, but that too failed.
After a bit of digging, the componentWillUnmount was causing the setState to be set to () => {}, despite the component being mounted subsequently.
I removed the
this.setState = () => { };
line and was able to verify this now works as expected and the field state is being updated.I suspect this must be with the way Next.js deals with state and mounting of components. However, I can't find anything to suggest it's the Next.js installation that's causing the issue (not directly at least).