How to set custom component for selected value with react select, i was able to customize options but how about selected option itself, would be smart to have the same selected component as options too, any ideas?
<Select
components={{ Option: CustomOption }}
options={options}
styles={customStyles}
/>;
Component:
const CustomOption = ({ value, label, innerProps, innerRef }) => (
<div ref={innerRef {...innerProps}>
<img src={label === 'En' ? pngEn : label === 'Ru' ? pngRu : pngLt} />
<div>{label}</div>
</div>
);
Edit, options bellow, i want to the flag would be seen then option is selected, thats probably because of custom options:
const options = [
{ value: "lt", label: "Lt" },
{ value: "en", label: "En" },
{ value: "ru", label: "Ru" },
];
