Skip to content

Commit

Permalink
fix: scroll 반 쯤 내려가 있는 문제 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
eugene028 committed Aug 6, 2024
1 parent fb89c7e commit c337694
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/components/layout/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,18 @@ import { media } from '@/styles';
import { color } from 'wowds-tokens';
import Header from '@/components/layout/Header';
import Footer from '@/components/layout/Footer';

import { Outlet } from 'react-router-dom';
import { useLayoutEffect } from 'react';
import { Outlet, useLocation } from 'react-router-dom';
import GlobalSize from '@/constants/globalSize';
import ApiErrorBoundary from '@/components/ApiErrorBoundary';

const Layout = () => {
const location = useLocation();

useLayoutEffect(() => {
window.scrollTo(0, 0);
}, [location]);

return (
<ApiErrorBoundary>
<Container>
Expand Down

0 comments on commit c337694

Please sign in to comment.