Skip to content

Commit

Permalink
chore: useLayoutEffect 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
presentKey committed Nov 27, 2023
1 parent a4ae3f5 commit 16f9750
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/features/auth/routes/Callback/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export default function Callback() {
useEffect(() => {
if (redirectUrl) {
const handleFetchUser = async () => {
console.log("Callback handleFetchUser");
await fetchUser();
handleRedirect();
};
Expand Down
6 changes: 3 additions & 3 deletions src/routes/privateRoutes.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PropsWithChildren, lazy, useLayoutEffect } from "react";
import { PropsWithChildren, lazy, useEffect } from "react";
import { RouteObject, useNavigate } from "react-router-dom";

import Layout from "@/components/Layout";
Expand All @@ -16,8 +16,8 @@ function PrivateRoute({ children }: PropsWithChildren) {
/**
* 유저 정보가 없다면 로그인 페이지로 이동합니다.
*/
useLayoutEffect(() => {
console.log("PrivateRoute useLayoutEffect");
useEffect(() => {
console.log("PrivateRoute useEffect");
console.log(user);

if (!user) {
Expand Down

0 comments on commit 16f9750

Please sign in to comment.