How can I show nested forms by Formik?

Viewed 140

I've a simple form but user can fill different nested forms in parent:

enter image description here

As you see, firstname + lastname + email are fix inputs, but client is able to click on education or skills to see another form on bottom the main form and complete that. but I cant do it by something like this:

<Formik>
  <Formik>
  </Formik>
</Formik>

Because we can't add a form tag into another form tag...

I can't show nested form out of my form, because in opens between form and there are another fields after that...

1 Answers

Try this:

<Formik>
 (formik) => (
    <Formik name="subform">(subformik) => (
        <input name="username" {...<props>}/>)
    </Formik>)
</Formik>
Related