How controllable props work in react-select
masterReact-select allows you to either let the component manage its own state or take control of it by providing specific props.
Controlled Mode If you provide these props, you are responsible for managing the state:
value/onChange: controls the current selected value.menuIsOpen/onMenuOpen/onMenuClose: controls whether the dropdown menu is open.inputValue/onInputChange: controls the text in the search input.
Uncontrolled Mode (Initial Values) If you do not provide the controlled props above, you can still set initial values using these props:
defaultValue: set the initial value of the control.defaultMenuIsOpen: set the initial open value of the menu.defaultInputValue: set the initial value of the search input.