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

setting shouldUnregister to false causing duplicated values #25

@deanvanniekerk

Description

@deanvanniekerk

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions