after initialize SyncErrors not firing when enableReinitialize is true
See original GitHub issueAre you submitting a bug report or a feature request?
bug report
What is the current behavior?
after I call the initialize function form not validate anymore when enableReinitialize is true. stuck on previous validation even if required fields filled.
What’s your environment?
redux form version: 6.6.3 latest
Other information
when I start debugging, find out that the values in form state in my application works without problems, but in componentWillReceiveProps
in redux form nextProps.values
always returning the initialized values even when I changed the form values. also, change action called in redux from and value in the view will update and render but the nextProps.values
still is the initialized values.
key: 'componentWillReceiveProps',
value: function componentWillReceiveProps(nextProps) {
console.log('nextProps', nextProps);
this.initIfNeeded(nextProps);
this.validateIfNeeded(nextProps);
this.warnIfNeeded(nextProps);
this.clearSubmitPromiseIfNeeded(nextProps);
this.submitIfNeeded(nextProps);
if (nextProps.onChange) {
if (!deepEqual(nextProps.values, this.props.values)) {
console.log('nextProps deepequal', nextProps);
nextProps.onChange(nextProps.values, nextProps.dispatch, nextProps);
}
}
}
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Redux form - enableReinitialize override previous data and ...
In order to solve this issue, I've tried to use "keepDirtyOnReinitialize" but nothing seems to change and I don't really know how to...
Read more >Initializing From State - Redux Form
There are two methods to reinitialize the form component with new "pristine" values: Pass a enableReinitialize prop or reduxForm() config parameter set to...
Read more >Redux-Form's SyncErrors bug - CodeSandbox
When enableReinitialize is set to true, the syncErrors doesn't update properly after `initialize`. 1.
Read more >redux-form reset not working
It seems not correct because INITIALIZE would reset syncErrors. For many use cases, you will want to either hide your form component after...
Read more >erikras/redux-form - Gitter
I tried adding initialValues: {} in my @connect call but it's not working. Josh Bedo ... @reduxForm({form: 'reviewForm', enableReinitialize: true, validate, ...
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
For all of you using
redux-saga
, perhaps check out this tool I just built to convert actions into aPromise
for libraries likeredux-form
.@danielrob, here is a sandbox where you can see what it’s described in this issue: https://codesandbox.io/s/vyvw87vv2l.
For me, adding
keepDirtyOnReinitialize: true
solved the problem, but I’m not sure if that’s ideal or the intended behaviour.PS: You may see a
Could not find module in path: 'redux-saga/effects'
error. Just refresh the preview that it works.