/formik-simple

Thin wrapper for Formik 'withForm' HOC

Primary LanguageJavaScriptThe UnlicenseUnlicense

formik-simple

This is a very small wrapper around the formik HOC to make usage a little simpler.

Usage

Allows for usage in the following manner:

<Component {...form.$('fieldA')} />

Or for nested properties:

<Component {...form.$('fieldB.subFieldC')} />

With values in the shape

{
    fieldA: 'fieldAValue',
    fieldB:{
        subFieldC: 'subFieldCValue'
    }
}

Errors (from yup validation) are also passed as props to the field components

See also

https://github.com/jaredpalmer/formik for withFormik API

Field pattern form.$ based on https://github.com/foxhound87/mobx-react-form