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

[ Feat ] router 연결 #14

Merged
merged 10 commits into from
Jul 7, 2024
Merged

[ Feat ] router 연결 #14

merged 10 commits into from
Jul 7, 2024

Conversation

j-nary
Copy link
Member

@j-nary j-nary commented Jul 5, 2024

#️⃣ Related Issue

Closes #13

✅ Done Task

  • 페이지별 폴더 분리
  • 라우터 연결

☀️ New-insight

  • createBrowserRouter 선택 이유
    • React Router v6에서 도입된 새로운 라우팅 설정 방법

    • 복잡한 라우팅 구조를 보다 직관적으로 설정

    • 주요 구성 요소

      1. createBrowserRouter
        • 브라우저의 히스토리 API를 사용
        • 라우트 객체 배열을 인자로 받아서 라우터 객체 생성
      2. RouterProvider
        • 애플리케이션에 라우터 객체 공급하여 라우팅 설정
        • 라우터 객체를 RouterProviderrouter 속성에 전달하여 사용
      3. 라우트 객체 배열
        • 각 라우트의 경로와 해당 경로에 렌더링될 컴포넌트 정의
        • 중첩된 라우트 정의 → 자식 라우트 설정 가능
    • 필요한 패키지 설치

      yarn add react-router-dom@6
      yarn add react react-dom   // 설치되지 않았다면 실행

      → 이미 설치되어있는거 package.json 에서 확인하고 패스

💎 PR Point

📸 Screenshot

image

@j-nary j-nary added ✨ Feat 새로운 기능 추가 (새로운 구현) labels Jul 5, 2024
@j-nary j-nary self-assigned this Jul 5, 2024
@github-actions github-actions bot added the size/m label Jul 5, 2024
Copy link
Collaborator

@lydiacho lydiacho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨습니다 🩵

한가지 제안 드리자면,
현재 페이지 컴포넌트 (각 페이지의 최상위 컴포넌트) 명이 path (camelCase -> PascalCase) 로 되어있는데, 혹시 이걸 path+Page 로 바꾸는건 어떨까요?

ex) <HomePage />, <SeniorOnboardingPage />, <SeniorProfilePage /> ...

페이지 내부에서 사용하는 컴포넌트가 아닌, 페이지 최상위 컴포넌트라는걸 네이밍을 통해 직관적으로 파악 가능하게 하면 좋을 것 같아 제안드립니다!

src/Router.tsx Outdated
Comment on lines 27 to 34
{
path: 'seniorProfile',
element: <SeniorProfile />,
},
{
path: 'juniorProfile',
element: <JuniorPromise />,
},
Copy link
Collaborator

@lydiacho lydiacho Jul 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p2) 요기 juniorProfile -> <JuniorPromise /> 으로 되어있는데 seniorProfile 과의 일관성을 위해 여기서도 컴포넌트명까지 <JuniorProfile로 /> 다 통일하는거 어떠신가요??

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p2) 아니면 Path를 juniorPromise로 하는 건 어떤가요 ? 후배약속잡는뷰이니깐 !

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

넵 통일했습니당 ㅎㅎㅎ 오타났었네용

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p5) 선배프로필 보는 부분, 주니어가 약속잡는거 직관적이고 좋은 거 같아욤!

src/Router.tsx Outdated
Comment on lines 19 to 26
{
path: 'seniorOnboarding',
element: <SeniorOnboarding />,
},
{
path: 'juniorOnboarding',
element: <JuniorOnboarding />,
},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Onboarding이 두 플로우가 동일한 path를 사용하게 될 수도 있을 것 같은데, 일단 이렇게 해두고 제가 작업하면서 path 통합하는게 낫겠다! 싶으면 그때 수정하겠습니다 :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

앗 넹 !! 감사합니다람쥐 !!!>_<!!!

Copy link
Collaborator

@se0jinYoon se0jinYoon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

src/Router.tsx Outdated
Comment on lines 27 to 34
{
path: 'seniorProfile',
element: <SeniorProfile />,
},
{
path: 'juniorProfile',
element: <JuniorPromise />,
},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p2) 아니면 Path를 juniorPromise로 하는 건 어떤가요 ? 후배약속잡는뷰이니깐 !

element: <JuniorPromisePage />,
},
],
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p2) 2차 스프린트로 넘어간 부분이니까 없어도 괜찮을 거 같아요!!

Copy link
Collaborator

@ijieun ijieun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니당 !!

Copy link
Contributor

@yarimu yarimu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨어용!

@lydiacho lydiacho merged commit 5b999ac into develop Jul 7, 2024
1 check passed
@lydiacho lydiacho deleted the feat/#13/router branch July 9, 2024 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Feat 새로운 기능 추가 (새로운 구현) size/m
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ Feat ] Router 설정
5 participants