Formik - How to reset form after confirmation

后端 未结 3 1113
时光说笑
时光说笑 2021-02-12 13:42

In Formik, how to make the Reset button reset the form only after confirmation?

My code below still resets the form even when you click Cancel.

3条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-12 14:10

    I understand OP's question was for Formik.

    However, for anyone using useFormik hook and wanting to clear form on 'reset' button click, here's one way to achieve that.

提交回复
热议问题