Formik: What's the best way to make a submit button outside the Form?

Created on 26 Nov 2019  路  2Comments  路  Source: formium/formik

鉂換uestion

I know this has been asked multiple times, but I can't get a good solution. React Ref's don't seem to do it, and giving the button & form the same id only seem to submit the form via url, which is buggy in a SPA.

Formik Duplicate User Land

Most helpful comment

You can use a ref and call submitForm(). Otherwise you must lift <Formik> higher up your react tree

All 2 comments

Any solutions?

You can use a ref and call submitForm(). Otherwise you must lift <Formik> higher up your react tree

Was this page helpful?
0 / 5 - 0 ratings

Related issues

najisawas picture najisawas  路  3Comments

pmonty picture pmonty  路  3Comments

giulioambrogi picture giulioambrogi  路  3Comments

Jucesr picture Jucesr  路  3Comments

PeerHartmann picture PeerHartmann  路  3Comments