react-router-last-location icon indicating copy to clipboard operation
react-router-last-location copied to clipboard

Doesn't work for reload

Open nikhil271995 opened this issue 5 years ago • 5 comments

If the current route was A and a reload happens on route A and then user moves to route B then last route comes as null instead of A.

nikhil271995 avatar Mar 31 '19 21:03 nikhil271995

@nikhil271995 Hey, thanks for reporting the issue.

Probably you meant scenario like this:

  1. Visit /, last = null
  2. Visit /about, last = /
  3. Visit /contact, last = /about
  4. Refresh/reload /contact, last = null

Could you confirm that scenario described by me is what you meant?

hinok avatar Mar 31 '19 21:03 hinok

I can confirm scenario 4. The last location is missing if the page is reloaded. Would be great if you could pass a persitor function to the LastLocationProvider . In that case, each user could implement its own lastLocation caching strategy.

taverasmisael avatar May 30 '19 13:05 taverasmisael

@taverasmisael Yup, I'm happy to add such functionality to the lib. Will try to finish work on this and #17

hinok avatar Jun 05 '19 09:06 hinok

Any update on this?

shiro avatar Oct 25 '20 19:10 shiro

It still doesn't work on page reload, any update?

Hervera avatar Jul 02 '21 05:07 Hervera