1
0
mirror of https://github.com/tabler/tabler-icons.git synced 2025-08-01 11:50:25 +02:00

Fix TablerIconProps type definition

This commit is contained in:
Andrew Haines
2022-09-16 11:53:32 +01:00
parent 2f2ece5d54
commit f0a6fe9328
2 changed files with 6 additions and 2 deletions

View File

@@ -662,7 +662,7 @@ gulp.task('svg-to-react', gulp.series('clean-react', async (cb) => {
}
let indexCode = '',
indexDCode = `import { FC, SVGAttributes } from 'react';\n\ninterface TablerIconProps extends SVGAttributes<SVGElement> { color?: string; size?: string | number; stroke?: string | number; }\n\ntype TablerIcon = FC<TablerIconProps>;\n\n`
indexDCode = `import { FC, SVGAttributes } from 'react';\n\ntype TablerIconProps = Omit<SVGAttributes<SVGElement>, 'color' | 'stroke'> & {\n color?: SVGAttributes<SVGElement>['stroke'];\n size?: SVGAttributes<SVGElement>['width'];\n stroke?: SVGAttributes<SVGElement>['strokeWidth'];\n}\n\ntype TablerIcon = FC<TablerIconProps>;\n\n`
await asyncForEach(files, async function(file) {
const svgCode = optimizeSvgCode(fs.readFileSync(file).toString()),

View File

@@ -1,6 +1,10 @@
import { FC, SVGAttributes } from 'react';
interface TablerIconProps extends SVGAttributes<SVGElement> { color?: string; size?: string | number; stroke?: string | number; }
type TablerIconProps = Omit<SVGAttributes<SVGElement>, 'color' | 'stroke'> & {
color?: SVGAttributes<SVGElement>['stroke'];
size?: SVGAttributes<SVGElement>['width'];
stroke?: SVGAttributes<SVGElement>['strokeWidth'];
}
type TablerIcon = FC<TablerIconProps>;