Skip to content

Victory typing breaks on upgrade to React 19 #3076

@johnnywang

Description

@johnnywang

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Victory version

37.3.6

Code Sandbox link

No response

Bug report

Working on upgrading our app to Expo 53 and React Native 0.79, with the React 19 upgrade. Bumped `@types/react` and `@types/react-dom` to v19 as well to match, and encountering the following TS error when using Victory components:


TS2786: VictoryChart cannot be used as a JSX component.
Its type (props: VictoryChartProps) => Element is not a valid JSX element type.
Type (props: VictoryChartProps) => Element is not assignable to type
(props: any) => ReactNode | Promise<ReactNode>
Type Element is not assignable to type ReactNode | Promise<ReactNode>
Property children is missing in type ReactElement<any, any> but required in type ReactPortal


This is possibly related to https://github.com/DefinitelyTyped/DefinitelyTyped/issues/66841, though we were previously on `@types/react` 18.3.12 and `@types/react-dom` 18.3.1 and those worked fine.

Steps to reproduce

Expected behavior

No typing errors

Actual behavior

Typing errors

Environment

- Device: Desktop
- OS: MacOS 26
- Node: 22
- Yarn: 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: Bug 🐛Oh no! A bug or unintentional behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions