The default message shown by react-select
when there is no data found while typing is No option
. Is it possible to customize this message?
You can define your own NoOptionMessage component: import { components } from 'react-select'; const NoOptionsMessage = props => { return ( <components.
You can use an attribute defaultValue to set the default value in the Select menu If none option is integrated with this attribute first option is selected by default. You can create an Array of the object where you will store all options to be displayed and any single object is passed in the defaultValue attribute.
You can use noOptionsMessage prop
like this:
<Select options={options} noOptionsMessage={() => 'FOOOO!'}/>
You can see it working here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With