Skip to content

Commit

Permalink
refactor: use object destructuring
Browse files Browse the repository at this point in the history
  • Loading branch information
jsapro committed Jan 7, 2024
1 parent 9436233 commit 0f783dd
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/layouts/layout/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ type LayoutProps = {
};

const Layout: React.FC<LayoutProps> = ({ children }) => {
const location = useLocation();
const page = location.pathname;
const { pathname } = useLocation();

useEffect(() => {
window.scrollTo(0, 0);
}, [page]);
}, [pathname]);

return (
<div className={style.layout}>
Expand Down

0 comments on commit 0f783dd

Please sign in to comment.