react-native-formik-components

formik helper components to reduce boilerplate in React Native

Usage no npm install needed!

<script type="module">
  import reactNativeFormikComponents from 'https://cdn.skypack.dev/react-native-formik-components';
</script>

README

react-native-formik-components

Formik helper components to reduce boilerplate in React Native

Install

yarn add react-native-formik-components formik

Example

import { Formik } from 'formik';
import { Input, Form, DebugForm } from 'react-native-formik-components';

function MyForm() {
  return (
    <Formik
      initialValues={{ email: '', firstName: '', password: '' }}
      onSubmit={console.log}
    >
      <Form>
        {formik => {
          return (
            <>
              <Input name="email" type="email" placeholder="Email" />
              <Input name="firstName" type="name" placeholder="Name" />
              <Input name="password" type="password" placeholder="Password" />
              <DebugForm />
            </>
          );
        }}
      </Form>
    </Formik>
  );
}