diff --git a/src/utils/parseReactSvgContent.ts b/src/utils/parseReactSvgContent.ts index ed8765d..d5e56bf 100644 --- a/src/utils/parseReactSvgContent.ts +++ b/src/utils/parseReactSvgContent.ts @@ -29,8 +29,8 @@ export const parseReactSvgContent = async ({ let structuredCode = ""; if (typescript) { structuredCode = - `import * as React from 'react';\n\n` + - `const ${componentName} = (props: React.SVGProps) => (\n ${reactifiedSvg}\n);\n\n` + + `import type { SVGProps } from "react";\n\n` + + `const ${componentName} = (props: SVGProps) => (\n ${reactifiedSvg}\n);\n\n` + `export { ${componentName} };`; } else { structuredCode = `const ${componentName} = (props) => (\n ${reactifiedSvg}\n);\n\nexport { ${componentName} };`;