Skip to content

How to get the value of the Select component? #5010

Answered by karlkras
KonradLinkowski asked this question in Q&A
Discussion options

You must be logged in to vote

You get this out of the value of the event from your onChange handler:

<ReactSelect
...
   onChange={event => processChange(event)}
...
/>

and your handler:

    const processChange = (event: React.ChangeEvent<HTMLSelectElement>) => {
        // event will have whatever was selected.
    }

hope this helps.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@KonradLinkowski
Comment options

Answer selected by KonradLinkowski
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants