react-indiana-drag-scroll icon indicating copy to clipboard operation
react-indiana-drag-scroll copied to clipboard

Indiana Drag Scroll is not working with React 19

Open ShahidNauman opened this issue 1 year ago • 5 comments

I updated my Vite project to React 19, but unfortunately the current/next version of react-indiana-drag-scroll doesn't work with it.

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
npm error Could not resolve dependency:
npm error peer react@"^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0" from [email protected]
npm error node_modules/react-indiana-drag-scroll
npm error   react-indiana-drag-scroll@"3.0.3-alpha" 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.

ShahidNauman avatar Dec 30 '24 10:12 ShahidNauman

@Norserium I tried to fix it and forked the repo but I had a lot of error about lint etc etc. I arrived ad one point where both example and the lib works. I tried also react 19 (on my codebase based on previous point) and it works. After that I restore react 17 in both example and the lib.

So my conclusion is that the error come from an obsolete peer dependency. We can add "|| ^19.0.0" (and maybe remove 15...)

We can proceed with 2 solutions if you agree

  • I will open a PR with only a commit in "package.json" where I add "^19"
  • I will open a PR with A LOT OF changes (for example cra with version 5 since there is vrsion 2.x in this project)

Since the project seem old maybe a good idea id to rework all like:

  • use turborepo to handle multirepo (lib and example)
  • use CRA 5.x like I did (or maybe vite...)
  • drop support for react 15/16
  • use fixed node version
  • add instructions to readme for developer.

We use this library in a production site. That' why I'm here :)

multivoltage avatar Jan 15 '25 23:01 multivoltage

Hello, any chance of getting the first and simpler point released (I will open a PR with only a commit in "package.json" where I add "^19")?

Thank you Jakub

jakubvojacek avatar Mar 01 '25 11:03 jakubvojacek

@jakubvojacek, @multivoltage, @ShahidNauman, try to update to the latests version 2.2.1 / 3.0.4 (choice the major version that you use now).

Norserium avatar Mar 01 '25 15:03 Norserium

works, thank you :+1:

jakubvojacek avatar Mar 01 '25 17:03 jakubvojacek

I'll wait for the tag on git :) Thanks

multivoltage avatar Mar 01 '25 17:03 multivoltage