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.

Inconsistency when using redux-form and at the same time connect from redux

See original GitHub issue

Hi, 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:closed
  • Created 7 years ago
  • Comments:13

github_iconTop GitHub Comments

1reaction
stunazcommented, Jan 5, 2017

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

0reactions
lock[bot]commented, Dec 7, 2018

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Inconsistency when using redux-form and at the same time ...
Hi, I definitely see an inconsistency when I connect my form with redux-form only when I try to bind redux-form action creators with...
Read more >
Redux-Form is not connected to Router correctly
I am using redux-form and component is connect ed via withRouter . I tried to workaround it with changing to React.Component , but...
Read more >
Unit and Integration Testing of React/Redux Forms
Today, we'll talk about testing React forms that are connected with Redux, considering both unit and integration testing.
Read more >
Synchronous Validation Example - Redux Form
The first is to provide redux-form with a validation function that takes an object of form values and returns an object of errors....
Read more >
What are some alternatives to Redux Form? - StackShare
It is a Higher Order Component using react-redux to keep form state in a Redux store. ... Here's a link to Redux Form's...
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