Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

react history listen get previous location

let prevLocation;

history.listen(nextLocation => {
  console.log(prevLocation);
  // ...
  prevLocation = nextLocation;
});
Source by github.com #
 
PREVIOUS NEXT
Tagged: #react #history #listen #previous #location
ADD COMMENT
Topic
Name
4+9 =