question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

React 16.13.0 Warning: `Cannot update a component...` warning on push mutator

See original GitHub issue

Are 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:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
mikerudenkocommented, Mar 25, 2020

In the future, I think a better approach will be this lib- https://react-hook-form.com/ No render props, only hooks,

0reactions
erikrascommented, Mar 31, 2020
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found