Piyal George
Piyal George

Reputation: 313

React Redux form submit not giving right results

I'm trying to implement a form submit with react and redux. When i submit the data here, i want to get the results in actions (for redux purposes). I know we can do this by giving 'ref' in each input tags. but what i want to do it in react-redux method.

demo here

You can console and see the results obtaining as objects. but I'm not getting the right results.

Upvotes: 2

Views: 64

Answers (1)

Neeraj
Neeraj

Reputation: 483

I guess the issue is that you are using <input element with redux-form.

I recommend using <Field name="title" component="input" type="text" /> instead.

  1. Include it import { reduxForm, Field } from 'redux-form'
  2. <Field name="title" component="input" type="text" />
  3. console.log("i want the results right here ",form.movieForm.values.title);

Please NOTE: Its highly recommended to create a function within your component file which captures the input values and then calls the dispatch action creator

Upvotes: 2

Related Questions