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 warning using v5.0.0-rc.1 with redux-form.

See original GitHub issue

The following error appears using react-redux@5.0.0-rc.1 when I am unmounting component which renders redux-form’s <Field /> component only if the <Field /> has been previously focused. I know that it seems like problem with redux-form but when I switch back to react-redux@4.4.6 everything works fine.

warning.js:36 Warning: setState(...): Can only update a mounted or mounting component. This usually means you called setState() on an unmounted component. This is a no-op. Please check the code for the Connect(ConnectedField) component.

Tested on OSX and Chrome@54.0.2840.98 (64-bit) and Safari@10.0.1 (12602.2.14.0.7)

How to reproduce

  1. Clone the repository https://github.com/pilaas/react-redux-bug
  2. yarn
  3. npm run start
  4. Open browser http://localhost:8080
  5. Open console and enter type store.dispatch({type: 'SHOW_FORM'});
  6. Focus newly appeared input component
  7. Enter store.dispatch({type: 'HIDE_FORM'}); in console
  8. Experience warning

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
timdorrcommented, Dec 13, 2016

Pushed out a quick rc2 just now. I’ll try to do 5.0.0 final tomorrow once I’m done with some stuff related to my move this weekend. Draft is ready for the release notes.

1reaction
mariuszdevcommented, Dec 9, 2016

It’s just example project to demonstrate the problem. Programming patterns are not the case here. I don’t need a workaround, I just report the bug (?).

Read more comments on GitHub >

github_iconTop Results From Across the Web

setState warning using v5.0.1 with redux-form #588 - GitHub
In this case I get a warning: setState(...): Can only update a mounted or mounting component. This usually means you called setState() on...
Read more >
React-router-redux setState warning after redirect
I am having the same issue and basically it's a bug with the ConnectedRouter from react-router-redux v5.0.0-alpha.2 and alpha.3.
Read more >
Wizard Form - Redux Form
Wizard Form. One common UI design pattern is to separate a single form out into sepearate pages of inputs, commonly known as a...
Read more >
Installation - Redux Form
redux-form works with React Redux to enable an html form in React to use Redux to store all of its state. Installation. npm...
Read more >
v5 → v6 Migration Guide - Redux Form
I would love to provide new API and provide deprecation warnings on the old API, but there is just no path from here...
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