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
Because these might be in the schema, and it makes sense not to "manually" have to pull these things from the schema. I've tried it before, and it's exceedingly difficult to do, and therefor feels very unstable. However, react-hook-forms can already do this, as evidenced by the register function. So why would you leave it out when we have no choice but to use Controller?
Edit: I guess defaultValue needn't be exposed explicitly, but if it would "use" the default value from the schema, then that error wouldn't appear and we wouldn't have to call useForm with defaultValues, pointlessly duplicating any defaults from the schema.
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
-
Especially compared to the
register
function, we are missing therequired
prop.But also, how about exposing the
label
from a yup schema, and the default value?It's a bit naff to have to sprinkle these missing props all over the place, while react-hook-form, IMO, is targetted to make thing easier.
Currently, as we all know, the
field
property exposes only this set:It'd be so nice if it could also expose:
Because these might be in the schema, and it makes sense not to "manually" have to pull these things from the schema. I've tried it before, and it's exceedingly difficult to do, and therefor feels very unstable. However, react-hook-forms can already do this, as evidenced by the
register
function. So why would you leave it out when we have no choice but to useController
?Edit: I guess
defaultValue
needn't be exposed explicitly, but if it would "use" the default value from the schema, then that error wouldn't appear and we wouldn't have to calluseForm
withdefaultValues
, pointlessly duplicating any defaults from the schema.Beta Was this translation helpful? Give feedback.
All reactions