react-select not working during onChange

See original GitHub issue

hi 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. image

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
ozhanefemeralcommented, Oct 10, 2020

onChange={([selected]) => selected}

works for me.

2reactions
bluebill1049commented, Jul 19, 2020

@skashi please take a look at the doc for render, we have updated the API https://react-hook-form.com/api#Controller

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found