Skip to content

Instantly share code, notes, and snippets.

@tygas
Created September 29, 2017 13:51
Show Gist options
  • Save tygas/3eabf264b80996ff346d99d8baa208da to your computer and use it in GitHub Desktop.
Save tygas/3eabf264b80996ff346d99d8baa208da to your computer and use it in GitHub Desktop.
componentDidMount() {
window.addEventListener('scroll', () => this.hideBar());
if (/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {
window.onpageshow = function (event) {
if (event.persisted) {
window.location.reload();
}
};
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment