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 have a question. Why does useWatch and <Controller/> subscribe only when rendered (I mean, that is obvious, but why it doesn't work with latest data on initial render)? If I have value in a state, for what reason, do I get default form value on 1st render? Why am i forced to do this?
For what exact reason isn't this the default way of rhf doing things?
Same issue with When I set value to something, I render it afterwards, my Controller is like: 'HUH I DONT KNOW NOTHING ABOUT THIS CHANGE' and I am forced to use my fixedWatch even in controllers, instead of render={({field: { value}}) - this feels super wrong. While it should be their purpose to render correct data.
Also it feels inccorect to use DefaultValues for a value that is not default, it has been changed, just not when the component was rendered for business reasons.
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
-
Hi,
I have a question. Why does useWatch and
<Controller/>
subscribe only when rendered (I mean, that is obvious, but why it doesn't work with latest data on initial render)? If I have value in a state, for what reason, do I get default form value on 1st render? Why am i forced to do this?For what exact reason isn't this the default way of rhf doing things?
Same issue with When I set value to something, I render it afterwards, my Controller is like: 'HUH I DONT KNOW NOTHING ABOUT THIS CHANGE' and I am forced to use my fixedWatch even in controllers, instead of
render={({field: { value}})
- this feels super wrong. While it should be their purpose to render correct data.Also it feels inccorect to use DefaultValues for a value that is not default, it has been changed, just not when the component was rendered for business reasons.
Beta Was this translation helpful? Give feedback.
All reactions