Closed foxt closed 2 months ago
I'm not entirely sure that's an issue here at the moment -- I thought AnyComponent
(from preact
itself) was meant to include class components.
Will need to double check.
Edit: have you explicitly typed that class component?
Found the issue, but I think this should be corrected upstream. If you're willing to patch in the meantime (patch-package
or pnpm patch
are great for this sort of thing), you can do this:
// node_modules/preact/src/index.d.ts
export type AnyComponent<P = {}, S = {}> =
| FunctionComponent<P>
- | Component<P, S>;
+ | ComponentConstructor<P, S>;
It works at runtime, but the typing has an error.