import { IoLogOutOutline } from 'react-icons/io5';
import { IconType } from 'react-icons';
How do I use the imported type 'Icon Type' ?
(alias) type IconType = (props: IconBaseProps) => JSX.Element
I am able to pass an icon as a prop when setting the type of icon to JSX.Element.
type LinkProps = {
to: string;
icon?: JSX.Element;
};
<Link to="logout" icon={<IoLogOutOutline />} />
However if I set it to 'Icon Type' it returns with the error:
"Type 'Element' is not assignable to type 'IconType'.
Type 'ReactElement<any, any>' provides no match for the signature '(props: IconBaseProps): Element'.ts(2322)"