Hello!
We're using react-select in our project and we need the abilty to customize prompt text (instead of default "Create option"), and I implemented it as prop. I think it would be useful for others.
Here is an example:
<Creatable
options={some_options}
multi={false}
promptText="My custom prompt"
/>
It can be done much easier, then I supposed. Sorry, closing issue :)
@alpolishchuk, How can this be done?
@garysed, there is a prop, called promptTextCreator, where you can pass a function, that returns desired prompt text, i.e.
promptTextCreator(value) {
return 'My custom prompt'
}
<Creatable
...
promptTextCreator={promptTextCreator}
/>
To those that come here, the prop name is now formatCreateLabel.
So:
formatCreateLabelCreator => (value) {
return 'My custom prompt'
}
<Creatable
...
formatCreateLabel={formatCreateLabelCreator}
/>
Most helpful comment
To those that come here, the prop name is now
formatCreateLabel.So: