fix: Make sure the DeprecatedSelect label is always a string (#23758)

Co-authored-by: JUST.in DO IT <justin.park@airbnb.com>
This commit is contained in:
Michael S. Molina 2023-04-20 15:37:56 -03:00 committed by GitHub
parent c9ca17220f
commit 7a6fb86cbb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -161,13 +161,15 @@ function styled<
filterOption,
ignoreAccents = false, // default is `true`, but it is slow
asText = (value: any) => String(value ?? ''),
getOptionValue = option =>
typeof option === 'string' ? option : option[valueKey],
getOptionLabel = option =>
typeof option === 'string'
? option
: option[labelKey] || option[valueKey],
: asText(option[labelKey]) || asText(option[valueKey]),
formatOptionLabel = (
option: OptionType,