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:
@@ -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()),
|
||||
|
6
icons-react/index.d.ts
vendored
6
icons-react/index.d.ts
vendored
@@ -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>;
|
||||
|
||||
|
Reference in New Issue
Block a user