Support for React 19
rolandjitsu opened this issue ยท 13 comments
Describe the feature you'd like:
It would be nice if this lib supports React 19. It should probably work, but when using npm to install deps, it fails with:
npm error code ERESOLVE
npm error ERESOLVE unable to resolve dependency tree
npm error
npm error While resolving: react-dropzone@0.0.0-development
npm error Found: @testing-library/dom@8.11.3
npm error node_modules/@testing-library/dom
npm error dev @testing-library/dom@"^8.11.3" from the root project
npm error
npm error Could not resolve dependency:
npm error peer @testing-library/dom@"^10.0.0" from @testing-library/react@16.0.1
npm error node_modules/@testing-library/react
npm error dev @testing-library/react@"^16.0.1" 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/rolandgroza/.npm/_logs/2024-11-16T11_33_00_199Z-eresolve-report.txt
npm error A complete log of this run can be found in: /Users/rolandgroza/.npm/_logs/2024-11-16T11_33_00_199Z-debug-0.log
react-dropzone
Suggested implementation:
I guess relaxing the react version range should be enough if there are no other issues?
Describe alternatives you've considered:
I'm trying npm install --force.
Teachability, Documentation, Adoption, Migration Strategy:
The problem here is React RC version that isn't supported due to the way npm treats peer dependencies.
I'm not eager to add a peer dep for rc versions. Maybe @eps1lon will chime in with a different opinion?
The problem here is React RC version that isn't supported due to the way
npmtreats peer dependencies. I'm not eager to add a peer dep for rc versions. Maybe @eps1lon will chime in with a different opinion?
Wouldn't extending the range to 19 + allowing 19 RCs work? Maybe it could be released on the next/beta channel so that we can use a pre-release of this lib with 19 RC allowed until 19 is stable?
Once React 19 will be released, our current peer dependencies range will include it. I don't think that pushing a new version of RTL is necessary just to support RC as long as using legacy-peer-deps is still an option and using a RC is not something that should be a best practice or a common pattern.
Once React 19 will be released, our current peer dependencies range will include it.
Hmm, your current range for React stops at 18 (includes all minor and patches)
react-testing-library/package.json
Line 69 in 3dcd8a9
Or am I looking in the wrong place? Or misreading the use of ^?
I don't think that pushing a new version of RTL is necessary just to support RC as long as using
legacy-peer-depsis still an option and using a RC is not something that should be a best practice or a common pattern.
I wasn't aware of the legacy-peer-deps flag. Still for downstream users of our package, installing without being aware of legacy-peer-deps is not possible. So we'd need to make that obvious somewhere. Also, using that flag may have unintended consequences.
But I guess for testing our lib (react-dropzone), the aforementioned flag is good enough.
Hmm, your current range for React stops at 18 (includes all minor and patches)
React 19 isn't released yet so there's nothing useful to put there.
Hmm, your current range for React stops at 18 (includes all minor and patches)
Once React 19 will be released, our current peer dependencies range will include it.
I've only mentioned it because:
Once React 19 will be released, our current peer dependencies range will include it.
Which in my mind meant that this package needs no change to allow React 19 to be used without that peer deps error.
In any case, have you guys tested this lib with the latest pre-release of React? Or you don't think there're gonna be any issues and the transition will be seamless?
In any case, have you guys tested this lib with the latest pre-release of React? Or you don't think there're gonna be any issues and the transition will be seamless?
We automatically test it on pushes and PRs with latest Canary and Experimental release. Last time I looked, everything was fine and since then nothing related change so I'm confident it's working.
Which in my mind meant that this package needs no change to allow React 19 to be used without that peer deps error.
Why would it require no change? We currently don't list ^19.0 in the version range.
Which in my mind meant that this package needs no change to allow React 19 to be used without that peer deps error.
Why would it require no change? We currently don't list
^19.0in the version range.
Because @MatanBobi said:
Once React 19 will be released, our current peer dependencies range will include it. I don't think that pushing a new version of RTL is necessary just to support RC as long as using legacy-peer-deps is still an option and using a RC is not something that should be a best practice or a common pattern.
It literally says that the current peer deps range will include it. But maybe I misread the message.
It literally says that the current peer deps range will include it. But maybe I misread the message.
That was my misunderstanding, sorry about that.
It literally says that the current peer deps range will include it. But maybe I misread the message.
That was my misunderstanding, sorry about that.
No worries. Just wanted to make sure I understood the current state correctly and wasn't looking in the wrong place.
npm i react-dropzone --legacy-peer-deps, this worked!
Looks like the work got done but the release failed (https://github.com/testing-library/react-testing-library/actions/runs/12187127289/job/33997281908). Any idea of timeline for getting that resolved?
@justinwinslow support for React 19 was released as part of 16.1.0 which is available on npmjs, I'm not sure why the job failed:
https://www.npmjs.com/package/@testing-library/react?activeTab=versions