AsyncSelect from react-select returning [object Object] and not the desired value #2119
Answered
by
jacobgranberry
jacobgranberry
asked this question in
Q&A
-
Hey there - working on an issue with the react-select AsyncSelect component that loads options from an API and setting the value. I can't seem to get the value to return correctly - it returns the string thats [object Object]. Wondering if I can get a second set of eyes on this? The onChange handler also doesn't seem to fire. The resulting value on submit:
My component
My handleChange function.
And my data is an array of objects with the following shape:
|
Beta Was this translation helpful? Give feedback.
Answered by
jacobgranberry
Jul 8, 2020
Replies: 1 comment 1 reply
-
Fixed this by approaching it with a custom register via react-hook-form as seen here: |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
jacobgranberry
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Fixed this by approaching it with a custom register via react-hook-form as seen here:
https://react-hook-form.com/get-started#Registerfields