Skip to content

Commit

Permalink
Fix imports
Browse files Browse the repository at this point in the history
  • Loading branch information
ericfennis committed Dec 11, 2024
1 parent d309efc commit 17bf73e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/lucide-react/src/DynamicIcon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@ import Icon from './Icon';

export type DynamicIconModule = { default: LucideIcon, __iconNode: IconNode };

export type IconNames = keyof typeof dynamicIconImports;
export type IconName = keyof typeof dynamicIconImports;

export const iconNames = Object.keys(dynamicIconImports) as Array<IconName>;

interface DynamicIconComponentProps extends LucideProps {
name: IconNames;
name: IconName;
fallback?: () => JSX.Element | null;
}

async function getIconNode(name: IconNames) {
async function getIconNode(name: IconName) {
if (!(name in dynamicIconImports)) {
throw new Error("[lucide-react]: Name in Lucide DynamicIcon not found");
}
Expand Down

0 comments on commit 17bf73e

Please sign in to comment.