React 16.13.0 Warning: `Cannot update a component...` warning on push mutator
See original GitHub issueAre you submitting a bug report or a feature request?
bug report
What is the current behavior?
When I trying to trigger the push method to add f.e. todo item in my array I see this warning
Warning: Cannot update a component from inside the function body of a different component.
What is the expected behavior?
No warning. On version 16.12.0 no warning happened
What’s your environment?
Chrome 80 MacOS Catalina React 16.13.0
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Warning: Cannot update a component (`App`) while rendering ...
The error message will be displayed if parent (App) states are set while rendering children (C2). Specifically, while trying to render C2, React...
Read more >FieldArray - Redux Form
The FieldArray component is how you render an array of fields. It works a lot like Field . ... Allows you to provide...
Read more >cannot update a component while rendering a ... - You.com
This warning was introduced since React V16.3.0. ... Cannot update a component (`App`) while rendering a different component.
Read more >"Cannot update unmounted components" warning ... - YouTube
If you're using React's hooks and are running into a warning :" Can't perform a React state update on an unmounted component "...
Read more >Lists and Keys - React
Usually you would render lists inside a component. ... When you run this code, you'll be given a warning that a key should...
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
In the future, I think a better approach will be this lib- https://react-hook-form.com/ No render props, only hooks,
Published a fix in
react-final-form@6.4.0
andfinal-form@4.19.0
. That should fix this issue.Read more: https://github.com/final-form/react-final-form/issues/751#issuecomment-606212893