Can only update a mounting component. This usually means you called setState() outside componentWillMount() on the server. This is a no-op.
See original GitHub issueAre you submitting a bug report or a feature request?
Bug report. I have a problem on the SSR
Warning: setState(...): Can only update a mounting component. This usually means you called setState() outside componentWillMount() on the server. This is a no-op.
Please check the code for the ReactFinalForm(4.2.0)(undefined) component.
What’s your environment?
FinalForm v4.2.1 ReactFinalForm v3.1.2 React v16.2.0 node v8.9.4
Issue Analytics
- State:
- Created 6 years ago
- Reactions:6
- Comments:20 (8 by maintainers)
Top Results From Across the Web
setState(...): Can only update a mounted or ... - Stack Overflow
Warning: setState(...): Can only update a mounted or mounting component. This usually means you called setState() on an unmounted component. This is a...
Read more >Prevent React setState on unmounted Component
Warning: Can only update a mounted or mounting component. This usually means you called setState, replaceState, or forceUpdate on an unmounted ...
Read more >How to work with React the right way to avoid some common ...
Warning: Can't call setState (or forceUpdate) on an unmounted component. This is a no-op, but it indicates a memory leak in your application...
Read more >React setState usage and gotchas - ITNEXT
setState() will always lead to a re-render unless shouldComponentUpdate() returns false . To avoid unnecessary renders, calling setState() only when the new ...
Read more >Can only update a mounting component. This usually means ...
Can only update a mounting component. This usually means you called setState() outside componentWillMount() on the server. This is a no-op.
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 Free
Top 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
Can confirm, works great now.
In my case I’m not using nextjs. My flow looks like this;
getDataFromTree
renderToString
renderStatic
If I remove apollo (step 1), the renderStatic (step 3) and second render to string (step 4) the warning still persists.
I’ve found it only appears when using a
Field
component. Stripping the field components of props also doesn’t help; both a field with a render function that returns a custom component and just acomponent='input'
prop trigger the warning.