Skip to content

[labs/react] Version 1.1.0 causes Typechecking error for createComponent(), expects React v18 types #3429

@rblakeman

Description

@rblakeman

Which package(s) are affected?

React (@lit-labs/react)

Description

After upgrading our usage of @lit-labs/react recently from v1.0.9 to v1.1.0, we get Typechecking errors on all our usages of the createComponent() method:

Argument of type import("typeof .../node _modules/@types/react/index") is not assignable to parameter of type "typeof React'
    Type "typeof React' is missing the following properties from type "typeof React' :
        useDeferredValue, useTransition, startTransition, useId, and 2 more. ts(2345)

lit-labs 1 1 0 ts error

It appears that createComponent() method is expecting v18 of React types but I don't see it in the changelog or in the package.json as an expectation. Only React v17 is listed as expected and we are already using that.

Reproduction

Unfortunately, I cannot provide an example or exact steps to reproduce it as the work is in a private repo.

Workaround

Reverting @lit-labs/react back to v1.0.9 resolves this issue.

Is this a regression?

Yes. This used to work, but now it doesn't.

Affected versions

Failing in 1.1.0, working in 1.0.9

Browser/OS/Node environment

OS: macOS 12.6.1
Node: 16.14.0
NPM: 8.3.1
Yarn: 1.22.18

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions