Skip to content

Commit

Permalink
Fix importing..?
Browse files Browse the repository at this point in the history
  • Loading branch information
PadowYT2 committed Mar 19, 2024
1 parent 5894aad commit 7dcc974
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/react-icons/src/iconByString.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import * as React from "react";
import { Folder } from "./Folder";

export default async (folder: Folder, name: string): Promise<JSX.Element> => {
const module = await import(`./${folder}/index.esm.js`);
export const IconByString = async (
folder: Folder,
name: string,
): Promise<JSX.Element> => {
const module = await import(`./../../${folder}/index.esm.js`);
const icon = module[name];

if (typeof icon === "function") return icon;
if (typeof icon === "function") return icon();
return <></>;
};

0 comments on commit 7dcc974

Please sign in to comment.