How to use custom Input with Formik in React?

前端 未结 5 1276
無奈伤痛
無奈伤痛 2020-12-25 12:18

I\'m trying to use DatePicker within Formik. But when I click DatePicker\'s date its form value is not changed. Instead, I got this error:

Uncaught T

5条回答
  •  自闭症患者
    2020-12-25 12:53

    I resolve this like

     setFieldValue('joinedAt', e)}
    />
    

    Update on 2020-03-08:

    You can use e.target.value on setFieldValue's second prop, depends on your custom input design. Thanks to Brandon.

提交回复
热议问题