I am using primereact dropdown component https://primefaces.org/primereact/showcase/#/dropdown
But getting this warning:-
react_devtools_backend.js:2450 Warning: Encountered two children with the same key. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version.
in ul (created by DropdownPanel)
in div (created by DropdownPanel)
this.cities = [
{ name: 'Apple', code: '1' },
{ name: 'Rome', code: '2' },
{ name: 'Rome', code: '3' },
{ name: 'Paris', code: '4' },
{ name: 'Paris', code: '5' }
];
<Dropdown
value={this.state.selectedCity1}
options={this.cities}
onChange={this.onCityChange}
optionLabel="name"
placeholder="Select a City" />
How to fix this in primereact dropdown.