-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
React-compat type definitions for preact/compat
?
#2222
Comments
See #2150 (comment) It might help you |
Cool! But why we don't ship them by default? |
We do you can follow the |
I mean, we could improve even further by aliasing some of React types. Just a simple addition like #2150 (comment) could remove a lot of type incompatibilities in React libraries. I'm willing to file a PR if you don't mind. |
Added a pr that may solve some of these issues #2329 |
Can you alias them directly when you have compatible typings? |
Just a note, when a type is missing, typescript replaces it with This issue has simmered down probably because a workaround exists, but the posted workaround is not comprehensive, so people will adapt it as needed, resulting in everyone having a slightly different version, which creates some fragmentation. I've been impressed with the comprehensiveness of |
Our docs now instruct to alias If you run into any incompatibilities/missing types, please open an issue. We'd be happy to add them. |
I don't think this would be an easy task, but some libraries (i.e. linaria/react)'s type definitions are based on the type definitions of
@types/react
, which isn't compatible with Preact's type definitions. I tried aliasing TypeScript module resolution via tsconfig but it didn't give me the result I expected.Could we have a compatible type definitions on preact/compat? Any solutions for solving this type issue is also welcome.
The text was updated successfully, but these errors were encountered: