I was trying to use the CreatableSelect component with a list of options that do not match the default schema (the default looks something like this: {value:"", label:""}) and apparently when I add the prop getOptionLabel to tell the select component which parameter it should display in the options it breaks the label in the create option.
In this case I have a non searchable select component that lists a bunch of colors ({color:"") and i only want to trigger an api request when the "create" option is clicked. Whenever I have the getOptionLabel set to something other than "label" the create option has no label but it does render empty. If I had a label property to the colors options array it all works fine even when adding the getOptionLabel={(o) => o.label} prop.
Hey!
I was trying to use the CreatableSelect component with a list of options that do not match the default schema (the default looks something like this: {value:"", label:""}) and apparently when I add the prop getOptionLabel to tell the select component which parameter it should display in the options it breaks the label in the create option.
The above code is also in this sandbox: https://codesandbox.io/s/createable-select-bug-3g45xt.
In this case I have a non searchable select component that lists a bunch of colors ({color:"") and i only want to trigger an api request when the "create" option is clicked. Whenever I have the getOptionLabel set to something other than "label" the create option has no label but it does render empty. If I had a label property to the colors options array it all works fine even when adding the
getOptionLabel={(o) => o.label}
prop.