I have a dropwdown that has to display the flags of 3 countries and I have to choose one. But the dropdown logic works differently depending on the renderValue. I have 3 different cases :
Case 1
renderValue={value => <img src={value.country[0]} alt="RenderValue" />}
the flag of the renderValue is displayed but if you try to choose another value you have an error:
The above error occurred in the <ForwardRef(SelectInput)> component: (...)
Consider adding an error boundary to your tree to customize error handling behavior.
Case 2
renderValue={value => <img src={value[0]} alt="RenderValue" />}
the flag of the renderValue does not appear and if you try to choose another value it keeps displaying the RenderValue
Case 3
The renderValue is removed
Everything works but we have more rendervalue
Here is the select : https://codesandbox.io/s/reverent-fermat-zssow?fontsize=14
you can play with all three cases. Case 3 is the default case :)
I want the select to work with a renderValue I don't know what I'm doing wrong