-
When changing Controller name dynamically, the Controller triggers its input re-render where I got an example proof on CodeSandbox
Thoughts? Do you think this might be a bug or expected behavior? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
See this FAQ for an explanation. <Controller
+ key={currentName}
control={methods.control}
name={currentName}
render={({ field: { value, name } }) => {
console.log(`value for ${name}`, value);
}}
/> |
Beta Was this translation helpful? Give feedback.
-
Is there any downside in generally passing the field name as a key for every field in the whole application? |
Beta Was this translation helpful? Give feedback.
See this FAQ for an explanation.
<Controller + key={currentName} control={methods.control} name={currentName} render={({ field: { value, name } }) => { console.log(`value for ${name}`, value); }} />