Skip to content
Discussion options

You must be logged in to vote

Does useWatch's compute property solve your problem? This would allow you to trigger a re-render when name and description change but not when bars changes. Note that the returned watchedValue will no longer provide access to bars (though you can still use getValues() to access it).

const watchedValue = useWatch({
    control,
    name: fooPath,
    compute: ({ bars, ...rest }: FormValue) => {
      return rest; // This will be compared with deepEqual()
    }, 
});

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@tztzt
Comment options

Answer selected by tztzt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants