Skip to content

Commit

Permalink
add TablerIcon type (#1058)
Browse files Browse the repository at this point in the history
  • Loading branch information
naughton committed Apr 30, 2024
1 parent 4e53710 commit f961028
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/icons-react/src/tabler-icons-react.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ export * as iconsList from './icons-list';
export * from './aliases';
export { default as createReactComponent } from './createReactComponent';

export type { Icon, IconNode, IconProps } from './types';
export type { Icon, IconNode, IconProps, TablerIcon } from './types';
4 changes: 3 additions & 1 deletion packages/icons-react/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

import { FunctionComponent, ReactSVG } from 'react';
import { ForwardRefExoticComponent, FunctionComponent, RefAttributes, ReactSVG } from 'react';
export type { ReactNode } from 'react';

export type IconNode = [elementName: keyof ReactSVG, attrs: Record<string, string>][];
Expand All @@ -10,3 +10,5 @@ export interface IconProps extends Partial<Omit<React.SVGProps<SVGSVGElement>, '
}

export type Icon = FunctionComponent<IconProps>;

export type TablerIcon = ForwardRefExoticComponent<Omit<IconProps, "ref"> & RefAttributes<Icon>>;

0 comments on commit f961028

Please sign in to comment.