Goal: Get the input values from a material UI component and pass them to an action creator in a handleSubmit function.
<Field name='email'
component={email =>
<TextField
fullWidth
autoComplete='off'
className={classes.textField}
id='email-text-field'
label='Email'
value={email} />
} />
<Field name='password'
component={password =>
<TextField
type='password'
fullWidth
autoComplete='off'
className={classes.textField}
id='password-text-field'
label='Password'
value={password} />
} />
This is how it is being connected to Redux:
@reduxForm({form: 'loginForm', fields: ['email', 'password']})
The warnings I'm getting in my chrome dev tools console is:
Failed prop type: Invalid prop value
supplied to TextField.
Warning: Failed prop type: Invalid prop value
supplied to Input.`
Additionally, the email field in my login form shows [Object, object} My guess is that this is happening due to the fact that props are being passed from the
Any ideas on where I've gone wrong?
value
prop sets the value of the field. It seems that you want to retrieve it, so you should be looking at theonChange
handler. – Jake Haller-Roby