将 Formik 表单持久化并重新加载到 localStorage 中
Persist and rehydrate a Formik form.
npm install formik-persist --saveJust import the `` component and put it inside any Formik form. It renders null!
import React from 'react'
import { Formik, Field, Form } from 'formik'
import { Persist } from 'formik-persist'
export const Signup = () =>
;Only three props!
name: string: LocalStorage key to save form state todebounce:? number: Default is 300. Number of ms to debounce the function that saves form state.isSessionStorage:? boolean: default is false . Send if you want Session storage inplace of Local storage暂无开放 Issues,或尚未同步最近议题。