hinok / react-router-last-location

Provides access to the last location in react + react-router (v4.x, v5.x) applications. ❤️ Using hooks? useLastLocation | 💉 Using HOC? withLastLocation
MIT License
284 stars 24 forks source link

peerDependencies & testing-library for 2.0.1 in package.json are different in github from npm #65

Open iulianraduat opened 3 years ago

iulianraduat commented 3 years ago

Hi Dawid,

I am using React 17 and the peerDependencies in package.json from here (github) is including it, but the one published in npm registry no (even if they have the same 2.0.1 version).

It will be great to have a new version published in npm registry which also supports React 17 via peerDependencies.

Also you can use the bellow declaration to reduce the peerDependencies:

"peerDependencies": {
    "prop-types": "^15.6.0",
    "react": ">=15.5.4",
    "react-dom": ">=15.5.4",
    "react-router-dom": ">=4.1.1"
},

Many thanks, Iulian

joealden commented 3 years ago

@hinok do you think we could get a new version published sometime soon?

I know you mentioned in https://github.com/hinok/react-router-last-location/pull/57#issuecomment-903268891 that you wanted to do some cleanup on the recently made changes, so I'm wondering what the status on this is, and is this what is blocking a release of 2.0.2 (or 2.1.0)?

joealden commented 2 years ago

@hinok any update on the above?

teetotum commented 2 years ago

This poses a problem in my project now.

Addendum: Anyone having this problem right now: you can help yourself by specifying an override for the nested outdated dependency in your package.json. You basically tell npm to ignore the outdated dependency and use the same that your app uses.

{
  // your regular app dependencies
  "dependencies": {
    "react": "^18.0.0",
    "react-dom": "^18.0.0"
  },
  "overrides": {
    // the override can be defined as a reference to the app dependency
    "react": "$react",
    "react-dom": "$react-dom"
  }
}
adefrutoscasado commented 2 years ago

Having this problem too.

Cant use react-router-last-location@2.0.1 with react@17. Using NPM 8.1.2 throws an error in the install. Using previous versions of NPM ignores this problem.

npm ERR! Found: react@17.0.2
npm ERR! node_modules/react
npm ERR!   react@"^17.0.2" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^15.5.4 || ^16.0.0" from react-router-last-location@2.0.1
anzarsh commented 2 years ago

@hinok any updates? We need a new version with updated react dependencies, please 🙏

mturley commented 2 years ago

+1, this is now causing issues in my project as well. If there are other issues blocking a release perhaps a patch release can be made that only bumps the peerDependencies? (this change: https://github.com/hinok/react-router-last-location/pull/64)

Stranget0 commented 1 year ago

I have forked this and fixed some of mentioned peer dep issues in https://www.npmjs.com/package/react-router-last-location-17 as I had some issues with it as well within my project