jaredpalmer / formik

Build forms in React, without the tears 😭
https://formik.org
Apache License 2.0
33.95k stars 2.79k forks source link

Update Wizard docs for v2 #1725

Open johnrom opened 5 years ago

johnrom commented 5 years ago

related #1714

dickiedyce commented 4 years ago

That would be lovely - I'm trying to update the rather elegant codebox example to use hooks and a functional component rather than a class based one... and not getting very far ;-)

jsheflin commented 4 years ago

yes please

thepabloaguilar commented 4 years ago

Hi, guys! I'm trying to use the Wizard example with a customs form field from Tabler React! How can I integrate them?

Generally, I create forms using useFormik and I can assign the values of value & onChange as follow:

<Form.Input
  ...
  value={formik.values.firstName}
  onChange={formik.handleChange}
  ...
/>

I'm using this example!

Code on example:

<Wizard.Page>
  <div>
    <label>First Name</label>
    <Field
      name="firstName"
      component="input"
      type="text"
      placeholder="First Name"
      validate={required}
    />
    <Error name="firstName"/>
  </div>
</Wizard.Page>

My code:

<Wizard.Page>
  <Form.Group label='First Name' isRequired>
    <Form.Input
      id='firstName'
      name='firstName'
      type='text'
      placeholder='First name'
    />
  </Form.Group>
</Wizard.Page>