Web: Common: Layout: Refactoring.

This commit is contained in:
TatianaLopaeva 2020-12-24 18:03:51 +03:00
parent 4e7b414c03
commit 9c7936327a

View File

@ -5,8 +5,8 @@ export default function ScrollToTop() {
const { pathname } = useLocation();
useEffect(() => {
document.getElementById("customScrollBar") &&
document.getElementById("customScrollBar").scrollTo(0, 0);
const documentScrollElement = document.getElementById("customScrollBar");
documentScrollElement && documentScrollElement.scrollTo(0, 0);
}, [pathname]);
return null;