Adding new value to creatableselect on button click.
I am using CreatableSelect
from 'react-select/creatable'
, and I have to add new value to the select field by clicking on a button,
eg:
And I don’t want to show the create "text"
.
here is my code
<>
<CreatableSelect
isMulti
options={ options }
isClearable={false}
components={{
DropdownIndicator:() => null,
IndicatorSeparator:() => null
}}
/>
<span className="add-btn" onClick={handleCreateOption}>
<i className="bi bi-plus"></i>
</span>
</>