-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Missing types for react-dom/client package in compat #3845
Comments
I believe right now the recommended workaround is to alias this. In order to support the types for subpath imports, we need to have separate d.ts files - using a module declaration for |
I tried the solution given in preactjs/preact-www#1122 but I don't think it solves the actual issue, since |
Strange, seemed to work just fine in my tests. Can create a new project with |
I tried it using |
Whoops, indeed. Oddly, when I go to import either, the types will be sorta inferred (i.e., |
Describe the bug
When we switched to Preact using compat, we got the following TS error:
Could not find a declaration file for module 'react-dom/client'
. I've looked around but although this module does exist and everything functions like it should, I couldn't find type declarations for it.I solved it for now by adding a custom declarations file with the proper types, but it would be nice if this is included in Preact itself.
To Reproduce
I can't get preact/compat to work in codesandbox unfortunately. Simplest reproduction steps would be to alias Preact in a simple React 18 TS app.
Expected behavior
I would have expected that there would be types for react-dom/client in preact/compat, where I at most would have to add another entry to the "paths" in my tsconfig.json
The text was updated successfully, but these errors were encountered: