Skip to content

Commit af0cfa7

Browse files
committed
chore(renderers/preact): set preact as import source
To get rid of the ts-expect-error, we can set the import source as preact so it will resolve preact's `Component` rather than React's.
1 parent 9d1fc3e commit af0cfa7

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

code/renderers/preact/src/render.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ export const render: ArgsStoryFn<PreactRenderer> = (args, context) => {
1616
);
1717
}
1818

19-
// @ts-expect-error I think the type of Component should be Preact.ComponentType, but even that
20-
// doesn't make TS happy, I suspect because TS wants "react" components.
2119
return <Component {...args} />;
2220
};
2321

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{
22
"extends": "../../tsconfig.json",
3-
"compilerOptions": {},
3+
"compilerOptions": {
4+
"jsxImportSource": "preact"
5+
},
46
"include": ["src/**/*", "template/**/*"]
57
}

0 commit comments

Comments
 (0)