New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
V6 RC2 - change prop is not bound to dispatch #1247
Comments
I've updated to RC2 this morning and it seems this problem still exists. |
In This is because
Instead of:
It's missing the |
Ok guys ! After spending to much time on my problem, I finally end-up with the same conclusion with
@erikras What do you think ? Should the doc be changed so it won't say that blur and change are 2 "bound action creator, so it returns nothing". Or the opposite and the code be added the bindActionCreators there: const bindForm = actionCreator => actionCreator.bind(null, initialProps.form)
// Bind the first parameter on `props.form`
const boundFormACs = mapValues(formActions, bindForm)
const boundArrayACs = mapValues(arrayActions, bindForm)
const boundBlur = (field, value) => blur(initialProps.form, field, value, !!initialProps.touchOnBlur)
const boundChange = (field, value) => change(initialProps.form, field, value, !!initialProps.touchOnChange)
const boundFocus = bindForm(focus)
// Wrap action creators with `dispatch`
const connectedFormACs = bindActionCreators(boundFormACs, dispatch)
const connectedArrayACs = {
insert: bindActionCreators(boundArrayACs.arrayInsert, dispatch),
move: bindActionCreators(boundArrayACs.arrayMove, dispatch),
pop: bindActionCreators(boundArrayACs.arrayPop, dispatch),
push: bindActionCreators(boundArrayACs.arrayPush, dispatch),
remove: bindActionCreators(boundArrayACs.arrayRemove, dispatch),
removeAll: bindActionCreators(boundArrayACs.arrayRemoveAll, dispatch),
shift: bindActionCreators(boundArrayACs.arrayShift, dispatch),
splice: bindActionCreators(boundArrayACs.arraySplice, dispatch),
swap: bindActionCreators(boundArrayACs.arraySwap, dispatch),
unshift: bindActionCreators(boundArrayACs.arrayUnshift, dispatch)
}
const computedActions = {
...connectedFormACs,
...boundArrayACs,
blur: boundBlur,
change: boundChange,
array: connectedArrayACs,
focus: boundFocus,
dispatch
} and since we're here, for |
Would be nice if "change" was indeed a bound action creator as the documentation says. |
Yep, focus appears to be missing in the actionsCreators passed to the form props. |
It seems like this was fixed around v6.0.4. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
The documentation states that the action creators are bound to the Redux
dispatch
but it doesn't seem to be the case withchange
function.This does not work
But this works
The text was updated successfully, but these errors were encountered: