Inconsistency when using redux-form and at the same time connect from redux
See original GitHub issueHi, I definitely see an inconsistency when I connect my form with redux-form
only when I try to bind redux-form action creators with connect
like the following:
MyForm = reduxForm({
form: 'myform'
})(MyForm);
MyForm = connect(null, {initialize, reset, startSubmit, submit, change})(MyForm);
export default MyForm;
It works well when I use the dispatch
function as dispatch(initialize('myform'))
, but when I try to use the actions creators directly within my code as this.props.initialize('my form')
or this.props.startSubmit('my form')
, I got different errors/behaviours in different situations.
when using this.props.startSubmit('my form')
, some time it works, some time I get :
Uncaught TypeError: _this.props.startSubmit is not a function
some time I can only use the change
creator without specifying the 1st parameter (the form name):
this.props.change('my_field', my_value);
and it works, it really works like the function definition was change(field:String, value:any)
,
if i tried this.props.change('my_form' ,'my_field', my_value);
it will tried to set 'my_field'
as value to the field named my_form
, which is weird
Unfortunately I couldn’t narrow it down to the root cause yet.
Issue Analytics
- State:
- Created 7 years ago
- Comments:13
Top GitHub Comments
Using es6 as I did, they is no need to bind. But anyway, tried your way : same issue, still
Uncaught TypeError: _this.props.startSubmit is not a function
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.