gerhat / material-ui-formik-components

Formik ready material ui components
MIT License
85 stars 13 forks source link

I can not get the value of DateTimePicker #13

Closed victorbrugnolo closed 5 years ago

victorbrugnolo commented 5 years ago

I can not get the value of DateTimePicker, I set the name, but it is not passed to JSON in values

gerhat commented 5 years ago

Can please give an example?

victorbrugnolo commented 5 years ago

https://gist.github.com/victorbrugnolo/b58a66e1748c52a176cf6b215e654535

gerhat commented 5 years ago

Hi @victorbrugnolo

you need to remove value and onChange props from datetime field since state is taken care by formik. See below:

<Field name="datetime" component={DateTimePicker} />

And here is a working codesandbox of your gist: https://codesandbox.io/embed/unruffled-mestorf-90l64