Skip to content

When DevTools are enabled, resetting form works only on the second time #200

@michaelperrin

Description

@michaelperrin

When DevTools are enabled, re-initializing fields by resetting them only work the second time.
I created a Code sandbox to reproduce the issue

Steps to reproduce

  1. Create a form with a field
  2. Add a console log with a watch for that field
  3. Add a reset button that calls React Hook Form's reset method
  4. Test your page by filling in data for the field, and click on the reset button : you should see the console log with the reinitialized data for the field, and the field should be reinitialized
  5. Add DevTools to the page and click the reset button

Result

  • The console log is shown only the second time the reset button is clicked
  • The field is reset only the second second time the reset button is clicked
  • Everything works fine if DevTools are not enabled

Expected result

  • The console log should be shown with the reinitialized data
  • The field should be reinitialized

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