Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
adjustScrollPosition = () => {
if (window.location.hash) {
const animate = {
duration: 400,
offset: -this.height,
easing: (x, t, b, c, d) => -c * (t /= d) * (t - 2) + b,
};
animateScroll(window.location.hash.substr(1), animate)
.then(id => this.setState({ selectedAnchor: id }))
.catch(() => {});
}
};
adjustScrollPosition = () => {
if (window.location.hash) {
const animate = {
duration: 400,
offset: -this.height,
easing: (x, t, b, c, d) => -c * (t /= d) * (t - 2) + b,
};
animateScroll(window.location.hash.substr(1), animate)
.then(id => this.setState({ selectedAnchor: id }))
.catch(() => {});
}
};