function's as default values in react hook form #11264
Unanswered
AayushKarki714
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi guys, I was building a form with react hook form and react select and got caught up with an interesting minor detail
I wanted to have something like lazy initialization in react, where if the function is passed as an initial value it is only executed once. I tried to implement and encounter some issues. Lastly I came up with this solution. Is this ok??
(PS: I think it would be better if react hook form called the function internally)
here is the link where i have implemented my solution
Beta Was this translation helpful? Give feedback.
All reactions