The props noOptionsMessage not working, my implemention.
would it be a problem in the component or in my implementation? My version "react-select": "^1.3.0",
<Select
value={this.props.value}
onChange={this.onChange.bind(this)}
options={this.state.options}
searchable={this.props.searchable}
onKeyDown={this.handleKeyDown.bind(this)}
placeholder={this.props.label}
clearable={this.props.clearable}
noOptionsMessage={"Test"}
/>
or
<Select
value={this.props.value}
onChange={this.onChange.bind(this)}
options={this.state.options}
searchable={this.props.searchable}
onKeyDown={this.handleKeyDown.bind(this)}
placeholder={this.props.label}
clearable={this.props.clearable}
noOptionsMessage={() => return "Test"}
/>
Which version are you using? I had the same exactly problem. The solution was changing the prop name to "noResultsText", since we are using v1
Thank you @ammichael !!! this is work!
Now it's:
noOptionsMessage={() => "No values available"}
What is the intent that this prop is defined as a function?
(Just my intellectual curiosity 🤔)
sorry, self solved.
I understood that it's for handling input values in the message.
({inputValue}) => `some message with ${inputValue}`
noOptionsMessage={"No options"}
Most helpful comment
Now it's: