onChange handler doesn't fire when using custom-component
问题 I'm using Formik for validation in a React app. Validation is working correctly, but my onChange handler does not fire: <Field type="text" name="name" placeholder="First Name" component={Input} onChange={() => console.log("gfdg")} /> Link to Sandbox Why is this? 回答1: Inside Input , the way you have ordered the props passed to your input element means your onChange is being overwritten by Formik's onChange . When you create a Field with a custom component (i.e. Input in your case), Formik