score:6

useEffect(() => {
  return props.history.listen(location => {
    // do stuff here
  });
}, []);

Related Query

More Query from same tag