Skip to content

Commit

Permalink
feat: add current location in history wrapper (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
lfantone authored Apr 25, 2019
1 parent aeee61a commit c75075d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Before.component.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -218,12 +218,14 @@ export function Before(props: BeforeComponentWithRouterProps) {
const beforeHistory = useMemo(
() => ({
...history,
unstable_location: history.location,
unstable_push: history.push,
unstable_replace: history.replace,
push: createHistoryMethod('push'),
replace: createHistoryMethod('replace')
replace: createHistoryMethod('replace'),
location: currentLocation
}),
[history, createHistoryMethod]
[history, createHistoryMethod, currentLocation]
);

const routeProps = initialProps.current[currentLocation.pathname];
Expand Down

0 comments on commit c75075d

Please sign in to comment.