Warning: `label` of `value` is not same as `label` in Select options.

See original GitHub issue
  • I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

Edit on CodeSandbox

Steps to reproduce

选中其他option,就触发错误:Warning: label of value is not same as label in Select options.

What is expected?

期望不触发这个错误

What is actually happening?

触发错误:Warning: label of value is not same as label in Select options.

Environment Info
antd 4.18.7
React ^16.14.0
System window10
Browser Microsoft Edge 98.0.1108.50

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7

github_iconTop GitHub Comments

7reactions
ta9yucommented, Aug 24, 2022

I ran into the same problem. I fixed it by specifying optionLabelProp="children" in the Select component.

1reaction
m430commented, Nov 28, 2022

@ta9yu thanks, It works for me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Select Component with labelInValue option get wrong value
I use Select Component in Form.Item with getFieldDecorator, then select an option and see the log in console.
Read more >
While using select in 'antd' library (Ant Design ... - Stack Overflow
I am using select in the 'antd' (Ant Design) library. The selected option is showing the value of the option instead of the...
Read more >
Select - Ant Design
The labelInValue prop can be used to get the label property of the selected item. The label of the selected item will be...
Read more >
Select | Quasar Framework
The QSelect Vue component has two types of selection - single or multiple. This component opens up a menu for the selection list...
Read more >
HTML option label Attribute - W3Schools
Definition and Usage. The label attribute specifies a shorter version of an option. The shorter version will be displayed in the drop-down list....
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