Skip to content

Commit fb1011d

Browse files
BG-Software-BGBartłomiej Gawęda
and
Bartłomiej Gawęda
authored
Set return type of Component in SolidJS to JSX.Element (#1148)
Co-authored-by: Bartłomiej Gawęda <[email protected]>
1 parent cabd37d commit fb1011d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/icons-solidjs/src/createSolidComponent.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { JSX } from 'solid-js/jsx-runtime';
12
import defaultAttributes from './defaultAttributes';
23
import { splitProps } from 'solid-js';
34
import h from 'solid-js/h';
@@ -9,7 +10,7 @@ const createSolidComponent = (
910
iconNamePascal: string,
1011
iconNode: IconNode,
1112
) => {
12-
const Component = (props: IconProps) => {
13+
const Component = (props: IconProps): JSX.Element => {
1314
const [localProps, rest] = splitProps(props, ['color', 'size', 'stroke', 'title', 'children', 'class']),
1415
attributes = defaultAttributes[type];
1516

@@ -39,7 +40,7 @@ const createSolidComponent = (
3940
...iconNode.map(([tag, attrs]) => h(tag, attrs)),
4041
localProps.children
4142
],
42-
);
43+
) as unknown as JSX.Element;
4344
};
4445

4546
Component.displayName = `${iconNamePascal}`;

0 commit comments

Comments
 (0)