🛠️ Use `import type from SVGProps instead import * from React`
📦 Build / 🛠️ Build app (push) Has been cancelled
🧑‍🚀 Check / ⚙️ Linting (push) Has been cancelled
🧑‍🚀 Check / 📦 SVGs Size (push) Has been cancelled
🚀 Deploy / ☁️ API (push) Has been cancelled

This commit is contained in:
pheralb
2025-09-30 00:29:11 +01:00
parent 204b13c445
commit ab16011b25
+2 -2
View File
@@ -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<SVGSVGElement>) => (\n ${reactifiedSvg}\n);\n\n` +
`import type { SVGProps } from "react";\n\n` +
`const ${componentName} = (props: SVGProps<SVGSVGElement>) => (\n ${reactifiedSvg}\n);\n\n` +
`export { ${componentName} };`;
} else {
structuredCode = `const ${componentName} = (props) => (\n ${reactifiedSvg}\n);\n\nexport { ${componentName} };`;