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 Select component where I need to display options for the select alongside the defaultValue if provided all from API. I wonder if there is a better approach than I did here for retrieving the defaultValue if id is present alongside the options for the Select.
Unfortunate that react-qeuery dropped the onSuccess for useQuery hooks as it would simplify this code from that ugly useeffect. Or Am I missing something here?
P.S.
My stack: tRPC, Nextjs, React-Select, React-hook-from
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.
-
I have a Select component where I need to display options for the select alongside the defaultValue if provided all from API. I wonder if there is a better approach than I did here for retrieving the defaultValue if id is present alongside the options for the Select.
Unfortunate that react-qeuery dropped the onSuccess for useQuery hooks as it would simplify this code from that ugly useeffect. Or Am I missing something here?
P.S.
My stack: tRPC, Nextjs, React-Select, React-hook-from
Beta Was this translation helpful? Give feedback.
All reactions