JedWatson / react-select

The Select Component for React.js
https://react-select.com/
MIT License
27.42k stars 4.1k forks source link

Unexpected behaviour in combination with `react-hook-form` #5925

Closed emaborsa closed 2 weeks ago

emaborsa commented 2 weeks ago

I am trying to combine react-select with react-hook-form.

Here the sample.

Versions used

Steps to reproduce my problem:

Current behaviour:

https://github.com/JedWatson/react-select/assets/9129912/d80182cc-6519-41f9-9533-a11df27c94cc

Expected bevaviour:

emaborsa commented 2 weeks ago

FInally I got it, the problem are the undefined properties of the form, they have to be nullable instead, see this sample. Thanks to @"Vincent Peres" on stackoverflow.