Reactjs – Why typescript gets confused with union type
I was creating Select component in React with Typescript. Here is the code: type GenericSelectProps = { values: (Book | Movie)[]; onChange: (value: Book | Movie) => void; }; export const GenericSelect = ({ values, onChange }: GenericSelectProps) => {…