It's a feature request. React-Select is already a great library and this small feature request will remove one hard coding from it.
In Select-Createable , if we are creating a new option for a drop-down named "Stores", then instead of showing 'Create option for', we can show 'Create new Store {label}', which will make more sense
So, we should provide have some ability to provide this text as props, so user can customize it.
Pull request for the same #2492
This is available as promptTextCreator property.
Maybe I am just tired but do I understand correctly that promptTextCreator in v1 and formatCreateLabel in v2 should let us change the default Create "{<Users Input>}" to for example Search "{<Users Input>}" @jossmac ?
If this is true how should we pass this to the promptTextCreator? This does not work:
promptTextCreator={() =>Search}
Ty for a awesome library!
@t0mdicks0n are you asking about v1 or v2?
// V2
<Select
formatCreateLabel={userInput => `Search for ${userInput}`}
/>
Please see the docs and in the future please don't file GitHub issues to ask questions. Use Stack Overflow with a #react-select tag
There we go! Ty for helping out.
Will do!
@jossmac how we do that for v1? ..formatCreateLabel={userInput => Search for ${userInput}} doesn't work in v1.
@lausellduane see my comment, which references the promptTextCreator function from the v1 docs.
Most helpful comment
Please see the docs and in the future please don't file GitHub issues to ask questions. Use Stack Overflow with a #react-select tag