So, I have parent class, where I press button, and then call 'clearValue' method of TagSelector, where I need to clear AsyncCreatableSelect input.
TagSelector class:
export default class TagSelector extends Component {
constructor(props) {
super(props);
this.state = {
tagDownloaded: []
};
clearValue = () => {
console.log(this.refs.acs);
console.log("here I need to clear AsyncCreatableSelect"); // comment
}
render() {
return (
<AsyncCreatableSelect
ref="acs"
cacheOptions
loadOptions={this.promiseOptions}
isMulti
defaultOptions={this.state.tagDownloaded}
onChange={this.handleChange}
/>
);
}
}
I read api and know that 'clearValue' prop-method can help, but how - I don't know.