Skip to content

Support for React 19 #1364

Closed
Closed

Description

@rolandjitsu

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:

Activity

  1. MatanBobi commented on Nov 16, 2024

    @MatanBobi
    Member

    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?

  2. rolandjitsu commented on Nov 18, 2024

    @rolandjitsu
    Author

    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?

    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?

  3. MatanBobi commented on Nov 18, 2024

    @MatanBobi
    Member

    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.

  4. rolandjitsu commented on Nov 21, 2024

    @rolandjitsu
    Author

    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": "^18.0.0",

    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-deps is 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.

  5. eps1lon commented on Nov 21, 2024

    @eps1lon
    Member

    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.

  6. rolandjitsu commented on Nov 25, 2024

    @rolandjitsu
    Author

    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?

  7. eps1lon commented on Nov 25, 2024

    @eps1lon
    Member

    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.

  8. rolandjitsu commented on Nov 26, 2024

    @rolandjitsu
    Author

    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.

    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.

  9. MatanBobi commented on Nov 26, 2024

    @MatanBobi
    Member

    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.

  10. rolandjitsu commented on Nov 27, 2024

    @rolandjitsu
    Author

    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.

  11. dimatteoCarlos commented on Dec 1, 2024

    @dimatteoCarlos

    npm i react-dropzone --legacy-peer-deps, this worked!

  12. justinwinslow commented on Jan 8, 2025

    @justinwinslow

    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?

  13. MatanBobi commented on Jan 8, 2025

    @MatanBobi
    Member

    @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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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