Jul 26, 2017 · 1 min read
…solved:
const inPageAnchorHack = (location, currentPathname) => {
if (location.pathname == currentPathname){
return location.pathname;
}else{
return location.key;
}
};
<Switch
key={inPageAnchorHack(location, currentPathname)}
location={location}>