Persist and rehydrate a Formik values
npm install formik-persist-valuesPersist and rehydrate a Formik form values.
```
npm install formik-persist-values --save
``
yarn add formik-persist-values
Just import the component and put it inside any Formik form. It renders null!
`js
import React from 'react';
import { Formik, Field, Form } from 'formik';
import { PersistFormikValues } from 'formik-persist-values';
export const Signup = () => (
$3
-
name: string: LocalStorage key to save form state to.
- ignoreValues:? string[]: Provide array of keys if you need to do not persist some values.
- debounce:? number: Default is 300. Number of ms to debounce the function that saves form state.
- storage:? 'localStorage' | 'sessionStorage' | Storage: default is localStorage . Send if you want Session storage or your own storage instead of Local storage.
- persistInvalid:? boolean: default is false . Persist if you want to save values while the form is invalid.
- hashInitials:? boolean: default is false . Hash initials values to prevent conflict between initialValues and persistedValues.
- hashSpecificity:? number: default is 7` . Hash initials values specificity to prevent conflict between cache hashes.- Grigoriy Kolenko @kolengri
- Jared Palmer @jaredpalmer
- formik-persist
- Alex Kuchun @kuchun