Skip to content

TypeScript type error with React 19 types #708

@danielrentz

Description

@danielrentz

Describe the bug

Type error with React v19 types. The global type namespace JSX has been removed for better compatibility with other JSX libs.

https://react.dev/blog/2024/04/25/react-19-upgrade-guide#the-jsx-namespace-in-typescript

To Reproduce Try and recreate the issue in a Codesandbox:

just use @types/react v19 and react-intersection-observer in a project, and run tsc (without skipLibChecks).

node_modules/react-intersection-observer/dist/index.d.mts:163:20 - error TS2694: Namespace 'global.JSX' has no exported member 'IntrinsicElements'.

163     as?: keyof JSX.IntrinsicElements;
                       ~~~~~~~~~~~~~~~~~

Expected behavior

no type error

Desktop (please complete the following information):

  • OS: Windows 11

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions