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

Build breaks with React Router 5.2 #40

Closed johannesaxner-valtech closed 4 years ago

johannesaxner-valtech commented 4 years ago

After upgrading React Router to version 5.2 my builds break.

I get the following error:

Attempted import error: 'createLocation' is not exported from 'history'.

I assume this is due to the changes in history in the latest React Router and it's usage in the file RedirectWithoutLastLocation.tsx.

johannesaxner-valtech commented 4 years ago

After digging a bit I've realized this isn't a problem with React Router but rather with Azure Devops. It seems that it uses the history package in our project and not the one required by react-router-last-location. Builds work fine locally but break in Azure DevOps.