Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 138249

In formik, shorthand input field is not working

$
0
0

In Formik, I try to use {...formik.getFieldProps('email')} on my input field instead of using value, onChange, and onBlur. But it's not working.

This works :

<input id="email" name="email" type="text" value={formik.values.email} onChange={formik.handleChange} onBlur={formik.handleBlur} />

But this doesn't :

<input id="email" type="text" {...formik.getFieldProps("email")} />

Code is here : https://codesandbox.io/s/formik-pb-with-getfieldprops-83tze?fontsize=14

Any ideas ? Thanks !


Viewing all articles
Browse latest Browse all 138249

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>