You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I guess I'm running into a more unique use case where I'm editing items in an object (keyed by id), lets call it rather than an array, this is so I can decouple what a form item is from the actual UI. (so useFieldArray isn't there to help/save me, though there are use-cases that useFieldArray may not work with either.
Anyways, it's just today I realized a big part why Controllers might not play nice in setups that have nesting or parent/child editing is that Controller actually reads updates a lot more like an event bus it seems by default. It seems like this was the only behavior until very recently. This was pretty surprising since my understanding was Controller was to adapt to a controlled component in React. Did not realize for an (admittedly neat) optimization that this was actually not true and it was not correct to assume Controlled aligned with how React works.
I think the exact prop/arg deserved a big mention in the docs, but honestly even before this prop being exposed, it would've been extremely helpful & useful to know this. Anyways, I'm lucky and appreciate having this functionality now, but this would really benefit from being a clear concept to anyone using the library rather than a rabbit hole. It's also a neat thing to know bc without knowing this is how Controller's work, I would've never fully realized it's a nice little optimization than can help with some watches where you want to reduce the subscription down to the specific path/event vs an equality check.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I guess I'm running into a more unique use case where I'm editing items in an object (keyed by id), lets call it rather than an array, this is so I can decouple what a form item is from the actual UI. (so useFieldArray isn't there to help/save me, though there are use-cases that
useFieldArraymay not work with either.Anyways, it's just today I realized a big part why Controllers might not play nice in setups that have nesting or parent/child editing is that Controller actually reads updates a lot more like an event bus it seems by default. It seems like this was the only behavior until very recently. This was pretty surprising since my understanding was
Controllerwas to adapt to a controlled component in React. Did not realize for an (admittedly neat) optimization that this was actually not true and it was not correct to assume Controlled aligned with how React works.I think the
exactprop/arg deserved a big mention in the docs, but honestly even before this prop being exposed, it would've been extremely helpful & useful to know this. Anyways, I'm lucky and appreciate having this functionality now, but this would really benefit from being a clear concept to anyone using the library rather than a rabbit hole. It's also a neat thing to know bc without knowing this is how Controller's work, I would've never fully realized it's a nice little optimization than can help with some watches where you want to reduce the subscription down to the specific path/event vs an equality check.Beta Was this translation helpful? Give feedback.
All reactions