diff --git a/packages/react-icons/src/iconByString.tsx b/packages/react-icons/src/iconByString.tsx index 78e516f51..42667a6cf 100644 --- a/packages/react-icons/src/iconByString.tsx +++ b/packages/react-icons/src/iconByString.tsx @@ -1,10 +1,13 @@ import * as React from "react"; import { Folder } from "./Folder"; -export default async (folder: Folder, name: string): Promise => { - const module = await import(`./${folder}/index.esm.js`); +export const IconByString = async ( + folder: Folder, + name: string, +): Promise => { + 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 <>; };