Closed naughton closed 6 months ago
the type signature for all react icons is ForwardRefExoticComponent<Omit<IconProps, "ref"> & RefAttributes<Icon>> and Icon is not exported.
ForwardRefExoticComponent<Omit<IconProps, "ref"> & RefAttributes<Icon>>
Icon
maybe you could export a type like this for a better "dx"?
import { ForwardRefExoticComponent, RefAttributes, FunctionComponent } from "react"; export type TablerIcon = ForwardRefExoticComponent< Omit<IconProps, "ref"> & RefAttributes<FunctionComponent<IconProps>> >;
Then this type can be used where people want to allow their own typescript types to have TablerIcon typed values.
e.g.
import { type TablerIcon, IconTrash } from "@tabler/icons-react"; type MenuItem = { title: string; icon: TablerIcon; } const deleteMenuItem: MenuItem = { title: "Delete", icon: IconTrash }
I think there was a type Icon exported before the latest release. Might make sense to re-export it?
Icon type are exported in 3.0.2
the type signature for all react icons is
ForwardRefExoticComponent<Omit<IconProps, "ref"> & RefAttributes<Icon>>
andIcon
is not exported.maybe you could export a type like this for a better "dx"?
Then this type can be used where people want to allow their own typescript types to have TablerIcon typed values.
e.g.