react-select not working during onChange
See original GitHub issuehi react-select onChange doesn’t update the component properly. after the onChange’s return, the react-select display blank.
using your documentation codesandbox url, https://codesandbox.io/s/react-hook-form-controller-079xx
i added the following code to the react-select’s Controller,
onChange={([selected]) => { // React Select return object instead of value for selection return { value: selected }; }}
the react-select display is empty after i selected chocolate.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
React select onChange is not working - Stack Overflow
I am returning a select element in the render function in my react.js code. But whenever I change the select value, the function...
Read more >React Select onChange not working in v6 · Issue #2075 - GitHub
Describe the bug React Select onChange not working in v6 To Reproduce Steps to reproduce the behavior: Go to link Click on IceCream ......
Read more >react-select - npm
Start using react-select in your project by running `npm i react-select`. ... return ( <Select value={selectedOption} onChange={this.
Read more >API - React Select
A flexible and beautiful Select Input control for ReactJS with multiselect, autocomplete and ajax support.
Read more >Handle the onChange event on a Select element in React
To handle the onChange event on a select element in React, set the `onChange` prop on the select element. Keep the value of...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
onChange={([selected]) => selected}
works for me.
@skashi please take a look at the doc for
render
, we have updated the API https://react-hook-form.com/api#Controller