question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[v2] formatCreateLabel does not make any effect

See original GitHub issue

I want to change the “Create new …” menu option. I am passing formatCreateLabel handler which returns something like <span style={{ color: "red" }}>Add {inputValue}</span>; But this does not show up if I type in proper email address (in isValidNewOption handler I test every inputValue with email-validator). The expected "Create new… " option possibly shows up if I remove formatCreateLabel from the props of <Creatable/>… Is it a bug or thanks god I do something wrong? Here is my test case: Edit ReactSelect v2 tryouts (example.js)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
alyyousuf7commented, Dec 2, 2020

It seems that formatCreateLabel does not do anything if you have already defined the getOptionLabel prop.

It looks like getOptionLabel takes precedence over formatCreateLabel.

Here is the issue reproduced: https://codesandbox.io/s/recursing-montalcini-3jzu0

2reactions
alyyousuf7commented, Dec 3, 2020

It makes sense now. I got confused because the typings for getOptionLabel mentioned only string as the return type.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to format value of the React Select - Stack Overflow
I've organized an interface and functionality works, but I have one thing which I don't like. React select requires options in next format:...
Read more >
@commercetools-uikit/creatable-select-input - npm
Icon to display on the left of the placeholder text and selected value. Has no effect when isMulti is enabled. aria-label, CreatableProps['aria- ...
Read more >
API - React Select
A flexible and beautiful Select Input control for ReactJS with multiselect, autocomplete and ajax support.
Read more >
react-select-formatCreateLabel - CodeSandbox
CodeSandbox is an online editor tailored for web applications. ... react-select-formatCreateLabel. 0. 228. 6. ebonowebonow. TemplateReact Select Template ...
Read more >
Simple Sitemap – Automatically Generate a Responsive ...
wrapped in strict mode code which doesn't define any globals. It's inside a ... Some versions of I.E. have different rules for clearTimeout...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found