Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

use onchange with react select

const [valueState,setValueState] = useState("")
// create a function that handle the React-select event and
// save the value of that event on an state every time the component change
    const handler = (event) => {
        const value = event.value
        setValueState(value)
    }
<Select options={"your options"} onChange={handler}/>
 
PREVIOUS NEXT
Tagged: #onchange #react #select
ADD COMMENT
Topic
Name
2+2 =