Skip to content

Cannot install the library with React 19.0.0 #1769

Open
@christian-predebon

Description

@christian-predebon

I'm trying to use this library with React 19.0.0 but when I run npm install --save-dev @testing-library/react-native it gives me this error:

npm error code ERESOLVE
npm error ERESOLVE unable to resolve dependency tree
npm error
npm error While resolving: [email protected]
npm error Found: [email protected]
npm error node_modules/react
npm error   react@"19.0.0" from the root project
npm error   peer react@">=18.2.0" from @testing-library/[email protected]
npm error   node_modules/@testing-library/react-native
npm error     dev @testing-library/react-native@"13.2.0" from the root project
npm error   1 more (react-native)
npm error
npm error Could not resolve dependency:
npm error peer react@"^19.1.0" from [email protected]
npm error node_modules/react-test-renderer
npm error   peer react-test-renderer@">=18.2.0" from @testing-library/[email protected]
npm error   node_modules/@testing-library/react-native
npm error     dev @testing-library/react-native@"13.2.0" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.
npm error
npm error
npm error For a full report see:
npm error /Users/christianpredebon/.npm/_logs/2025-05-20T16_32_23_577Z-eresolve-report.txt
npm error A complete log of this run can be found in: /Users/christianpredebon/.npm/_logs/2025-05-20T16_32_23_577Z-debug-0.log

Also, if I install React 19.1.0 and then run the tests it says Incorrect version of "react-test-renderer" detected. Expected "19.1.0", but found "19.0.0".

Steps to Reproduce

  • create a project with Expo 53.0.9 and React 19.0.0
  • run cmd npm install --save-dev @testing-library/react-native

Versions

npmPackages:
  react: 19.0.0 => 19.0.0 
  react-native: 0.79.2 => 0.79.2 

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