Skip to content

useWatch rules update: initial value #952

Open
@SteffeyDev

Description

@SteffeyDev

The useWatch docs currently state that "The initial return value from useWatch will always return what's inside of defaultValue or defaultValues from useForm."

I noticed in my own testing (codepen) that this doesn't seem to be the case, and useWatch seems to return the current form value on mount instead of the default values. This PR (which added this feature) and an inspection of the current code seem to confirm that the current form values are used on initial load if available, and only fall back on the default values if it has to (not sure what that case is when _state.mount is false).

Am I implementing useWatch in a non-standard or unusual way, or are the docs out of date here, or perhaps the way it is worded is confusing me?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions