FormError causes warning 'Cannot update a component from inside the function body of a different component'
See original GitHub issueWhen following the tutorial at the section about server-side email validation, when introducing FormError
, the console reports the error:
Warning: Cannot update a component from inside the function body of a different component.
This looks to be coming from https://github.com/redwoodjs/redwood/blob/master/packages/web/src/form/form.js#L27
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Cannot update a component from inside the function body of a ...
If you call setState during a render on a different component, you will now see a warning: Warning: Cannot update a component from...
Read more >Bug: too hard to fix "Cannot update a component from inside ...
Queueing an update for any other component from within the actual rendering body of a function component is illegal. That's what this warning...
Read more >How to fix the "cannot update a component while rendering a ...
A quick guide to how I solved a confusing React error.
Read more >Cannot update a component from inside the function body of a ...
JavaScript : React Warning : Cannot update a component from inside the function body of a different component [ Gift : Animated Search...
Read more >How I fixed 'Cannot update a component from inside the ...
In this short article I'll highlight why Cannot update a component from inside the function body of a different component warning happened ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@thedavidprice Just to confirm - I was following the tutorial step by step and saw this in my console, so there was no custom code from my side involved - either some tweak to the tutorial or Redwood itself was my feeling. From a quick search about it seems to have been regularly encountered with React 16.3 as @dominicchapman mentioned.
Hey @thedavidprice I’m also seeing this warning when following the tutorial.
It seems React16.3.0
may have been over-firing these warnings and has since been fixed in16.3.1
, but looks likereact-hook-form
would be using16.3.1
anyway.Curious, if this could be linked to #162 ? If so, the fix might be as simple as using PascalCase oninputTagProps
(i.e.InputTagProps
) as described here. Hope this helps.–
Digging further, seems it could be a bug on Redwood side. As highlighted in React
16.3.0
release notes:So, think the
setError
call should be wrapped in auseEffect
?