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.

Creatable doesn't work with getOptionValue and getOptionLabel props

See original GitHub issue

When using Creatable component with getOptionValue and getOptionLabel props, the functionality to create new options does not work.

creatable_issue

Sandbox simple example here: https://codesandbox.io/s/creatable-custom-label-value-xr63g

The current workarround I’m using is to map the options to { label, value } format:

options.map( opt => ({ label: opt.name, value: opt.id }) )

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
kpatientcommented, Jan 23, 2020

Using getNewOptionData fixed this for me.

1reaction
chiptuscommented, Apr 19, 2022

should be re-opened, still happens

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to set the value of react select by using getOptionLabel
I need to prefill the select label by the activeSort name and id object. I can do that using the value prop in...
Read more >
React Select v1.x -> 2.x Upgrade Guide
Please open an issue if you need something clarified, or submit a PR if you ... If you don't use the controlled props,...
Read more >
Autocomplete API - Material UI - MUI
Name Type Default options * array renderInput * func autoComplete bool false
Read more >
TypeScript - React Select
This is the type of the option passed into the options prop (or the options ... formatOptionLabel , getOptionLabel , getOptionValue , isOptionDisabled ......
Read more >
getOptionValue - Code Search
packages/react-select/src/__tests__/Creatable.test.tsx · props = { ...BASIC_PROPS, ...props }; · const getOptionLabel = ({ title }: ...
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