Skip to content

Instantly share code, notes, and snippets.

@cameronbourke
Created May 14, 2016 04:04
Show Gist options
  • Save cameronbourke/44e7d355fdc4ebf99ebf93cf22401b92 to your computer and use it in GitHub Desktop.
Save cameronbourke/44e7d355fdc4ebf99ebf93cf22401b92 to your computer and use it in GitHub Desktop.
const handleRouterUpdate = function () {
// import bowser from 'bowser';
if (bowser.msedge) {
// wrapping in a setTimeout ensures that it runs
// after the route has finished transitioning
setTimeout(() => {
const favicons = document.querySelectorAll('link[rel="icon"]');
Array.prototype.forEach.call(favicons, (fav) => { fav.href = fav.href; });
}, 0);
}
};
...
render () {
<Router history={browserHistory} onUpdate={handleRouterUpdate}>
...
</Router>
}
@ostart
Copy link

ostart commented Sep 2, 2020

onUpdate is depricated now. How to solve the problem without onUpdate?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment