Skip to content

Missing types for react-dom/client package in compat #3845

@WDeenik

Description

@WDeenik
  • Check if updating to the latest Preact version resolves the issue

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions