An open API service indexing awesome lists of open source software.

https://github.com/itschip/keep-react-hook-form

A lib to store react-hook-form values in session storage.
https://github.com/itschip/keep-react-hook-form

Last synced: over 1 year ago
JSON representation

A lib to store react-hook-form values in session storage.

Awesome Lists containing this project

README

          

A lib to store `react-hook-form` values in session storage.

```tsx
type FormData = {
username: string;
email: string;
}

function App() {
const { register, watch, setValue } = useForm({ defaultValues: { email: '', username: '' } });

usePersistForm({
formName: "login",
watch,
setValue,
shouldValidate: true,
shouldDirty: true,
onRestored: (values) => {
console.log(values)
}
})

return (





);
}
```