setState warning using v5.0.0-rc.1 with redux-form.
See original GitHub issueThe 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
- Clone the repository
https://github.com/pilaas/react-redux-bug
yarn
npm run start
- Open browser
http://localhost:8080
- Open console and enter type
store.dispatch({type: 'SHOW_FORM'});
- Focus newly appeared input component
- Enter
store.dispatch({type: 'HIDE_FORM'});
in console - Experience warning
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:6 (5 by maintainers)
Top 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 >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 FreeTop 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
Top GitHub Comments
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.
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 (?).