This helped me a treat however I have a specific use case that breaks this.
Tony Cregan
1

…solved:

const inPageAnchorHack = (location, currentPathname) => {
 if (location.pathname == currentPathname){
 return location.pathname;
 }else{
 return location.key;
 }
};

<Switch
 key={inPageAnchorHack(location, currentPathname)}
 location={location}>

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.