Closed brandondurham closed 1 year ago
Added check (with test) to ensure name is set. If not, return. This would allow for setting up useFormPersist conditionally with a prop:
name
useFormPersist
const MyComponent = ({ persistKey }) => { const { watch, setValue } = useForm(); useFormPersist(persistKey, { setValue, watch, }); return ( <form> ... </form> ); };
Using MyComponent without useFormPersist:
MyComponent
<MyComponent persistKey={null} />`
Fixes #30
Added check (with test) to ensure
name
is set. If not, return. This would allow for setting upuseFormPersist
conditionally with a prop:Using
MyComponent
withoutuseFormPersist
:Fixes #30