tiaanduplessis/react-hook-form-persist

Doesn't seem to work on refresh

amritk opened this issue · 3 comments

I see the data in localStorage, however when I hit refresh, the data is there then it gets cleared before it can get loaded into the form.

useFormPersist(
    'form',
    { watch, setValue },
    {
      storage: window.localStorage,
    }
  )

SessionStorage works but can't figure out whats wrong with localStorage.

Looks like it is setting an empty object in the bottom useEffect after setting value with restoredData

Should be resolved with v3.0.0

Hi everyone,

The issue is still there for me. I am using Next.js with :

    "react-hook-form": "^7.36.1",
    "react-hook-form-persist": "^3.0.0"

The data is visible in the local Storage but it gets cleared before it can get loaded into the form.

Any ideas ? Thanks !