Skip to content

Workaround for dynamic namePath for Form? #45041

Answered by zombieJ
bombillazo asked this question in Q&A
Discussion options

You must be logged in to vote

You can do watch on the top level and wrap it:

const useMyWatch = (namePath, form) => {
  const root = useWatch('');
  return get(root, namePath);
};

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@crazyair
Comment options

@bombillazo
Comment options

@bombillazo
Comment options

@lilinhao1054
Comment options

Answer selected by bombillazo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants