Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/#81 root layout navigation error #82

Merged
merged 2 commits into from
Oct 7, 2024

Conversation

Zero-1016
Copy link
Member

What is this PR? ๐Ÿ”

Changes ๐Ÿ“

navigation error๋ฅผ ์ˆ˜์ •ํ•ฉ๋‹ˆ๋‹ค.

๋„ค๋น„๊ฒŒ์ด์…˜์„ ์‹œ๋„ํ•  ๋•Œ Root Layout์ด ์•„์ง ์™„์ „ํžˆ ์ค€๋น„๋˜์ง€ ์•Š์•˜๊ฑฐ๋‚˜, Root Layout ๋‚ด์—์„œ Slot ๋˜๋Š” ๋‹ค๋ฅธ ๋„ค๋น„๊ฒŒ์ดํ„ฐ๊ฐ€ ๋ Œ๋”๋ง๋˜์ง€ ์•Š์€ ์ƒํƒœ์—์„œ ๋„ค๋น„๊ฒŒ์ด์…˜์„ ํŠธ๋ฆฌ๊ฑฐํ•˜๊ธฐ ๋•Œ๋ฌธ์— ๋ฐœ์ƒํ•˜๋Š” ๋ฌธ์ œ

๋กœ๋”ฉ์ด ๋๋‚ฌ์„ ๋•Œ ํŽ˜์ด์ง€๋ฅผ ๋ณ€๊ฒฝํ•˜๋„๋ก ์ฝ”๋“œ๋ฅผ ์ˆ˜์ •ํ•ฉ๋‹ˆ๋‹ค.

  useEffect(
    function setToken() {
      if (typeof token === 'string' && typeof refresh === 'string') {
        setHeader('Authorization', `Bearer ${token}`);
        signIn(refresh);
      }

      setLoading(false);
      // ts-expect-error signIn์„ ๋„ฃ์„ ๊ฒฝ์šฐ ๋ฌดํ•œ ์žฌ ๋ Œ๋”๋ง์„ ํ•˜๊ฒŒ ๋ฉ๋‹ˆ๋‹ค.
    },
    [refresh, token]
  );

  useEffect(
    function isNotLoadRedirect() {
      if (!loading) {
        router.replace('/');
      }
    },
    [loading, router]
  );

@Zero-1016 Zero-1016 added ๐Ÿ“•Storybook ์Šคํ† ๋ฆฌ๋ถ ๊ด€๋ จ ํŒŒ์ผ์„ ์ถ”๊ฐ€ํ•ฉ๋‹ˆ๋‹ค. ๐Ÿ”จFix ๋ฒ„๊ทธ๋ฅผ ์ˆ˜์ •ํ•˜์˜€์Šต๋‹ˆ๋‹ค. labels Oct 7, 2024
@auto-assign auto-assign bot requested a review from sohyun215 October 7, 2024 15:51
Copy link

github-actions bot commented Oct 7, 2024

โžก๏ธ ์ถ”๊ฐ€๋œ Storybook ๋ฏธ๋ฆฌ๋ณด๊ธฐ: https://669c8e6cae62e39ff159b378-udiwowyjjk.chromatic.com/

@Zero-1016 Zero-1016 merged commit 452a402 into dev Oct 7, 2024
2 of 3 checks passed
@Zero-1016 Zero-1016 changed the title Fix/#77 root layout navigation error Fix/#81 root layout navigation error Oct 7, 2024
@Zero-1016 Zero-1016 linked an issue Oct 7, 2024 that may be closed by this pull request
@Zero-1016 Zero-1016 deleted the fix/#77-root-layout-navigation-error branch October 13, 2024 03:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
๐Ÿ”จFix ๋ฒ„๊ทธ๋ฅผ ์ˆ˜์ •ํ•˜์˜€์Šต๋‹ˆ๋‹ค. ๐Ÿ“•Storybook ์Šคํ† ๋ฆฌ๋ถ ๊ด€๋ จ ํŒŒ์ผ์„ ์ถ”๊ฐ€ํ•ฉ๋‹ˆ๋‹ค.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] root-layout-navigation-error
1 participant