Skip to content
This repository has been archived by the owner on Jun 15, 2022. It is now read-only.

setting shouldUnregister to false causing duplicated values #25

Open
deanvanniekerk opened this issue Nov 23, 2020 · 0 comments
Open

setting shouldUnregister to false causing duplicated values #25

deanvanniekerk opened this issue Nov 23, 2020 · 0 comments

Comments

@deanvanniekerk
Copy link

I have a created a generic component wrapper, based on this solution.

But if I set shouldUnregister to false, the values being duplicated in all inputs when form unmounts / mounts.

To replicate the issue.

  1. Enter some text into 'value1'
  2. Uncheck and check the checkbox
  3. Notice all inputs have the same value

https://codesandbox.io/s/react-hook-form-usetypedcontroller-forked-s53fs?file=/src/App.tsx

Thank you for the great library!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant