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.

setState can only update a mounted or mounting component

See original GitHub issue

Getting the above error inside the _onSelect() method.

_onSelect(id) {

          this.setState({
            id: id,
        });

        console.warn(id);

      }

and my onSelect looks like this

onSelect={this._onSelect.bind(this)}>

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
gs-akhancommented, Dec 22, 2016

Looking into this.

0reactions
gs-akhancommented, Jan 24, 2017

Closing because of inactivity. feel free to re-open… Thanks 😃

Read more comments on GitHub >

github_iconTop 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 >
Warning: setState(...): Can only update a mounted or ... - GitHub
"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 >
Untitled
Resolving the Can only update a mounted or mounting component warning. source. It is clear that this.setState can only be called on a...
Read more >
React: Stop checking if your component is mounted - Medium
Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your...
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