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

[#92] Chore: router type 선언 및 devtools 추가 #94

Merged
merged 7 commits into from
Mar 4, 2024

Conversation

Kim-Jaemin420
Copy link
Contributor

📝 작업 내용

Link, navigate의 path 타입을 추론할 수 있도록 router type 선언해주었습니다. Link 작성시 아래처럼 자동완성이 됩니다.
스크린샷 2024-03-04 오후 12 22 13

react query devtools와 tanstack router devtools를 설치하고 적용했습니다.

+) Link 타입을 적용하면서 타입이 맞지 않는 것들을 타입에 맞도록 수정해주었습니다.

close #92

@Kim-Jaemin420 Kim-Jaemin420 added the ⚙ Chore 설정 파일 변경 및 주석 제거 label Mar 4, 2024
@Kim-Jaemin420 Kim-Jaemin420 self-assigned this Mar 4, 2024
Copy link

vercel bot commented Mar 4, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
zzalmyu-frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 4, 2024 11:26am

Copy link
Contributor

@choi-ik choi-ik left a comment

Choose a reason for hiding this comment

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

LGTM!!!!🚀🚀🚀 덕분에 경로 설정 편해지겠네요 👍🏻

Copy link
Contributor

@HY219 HY219 left a comment

Choose a reason for hiding this comment

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

재민님 고생하셨습니다!! :)

Link path에 타입 추론이 가능하도록 작성할 수 있다는 것 배워갑니다 😁

devtools로 편리하게 확인이 가능하겠네요 👍

  • 추가로, PR 올리신 부분이랑 조금 다른 내용인데, imageId가 서버에서는 int 값으로 오는데 경로에 사용할 때는 number가 아니라 string으로 타입 설정을 해야하나요?
    path나 API 연결 url에 imageId에 대한 타입지정이 궁금해 여쭤봅니다!

src/App.tsx Outdated
@@ -1,13 +1,20 @@
import { RouterProvider, createRouter } from "@tanstack/react-router";
import { OverlayProvider } from "@toss/use-overlay";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";

Copy link
Contributor

Choose a reason for hiding this comment

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

import 사이에 개행 추가하신 이유가 있는지 궁금합니다 :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

devtools 추가/삭제하다 보니 실수했네요! 감사합니다ㅎㅎ

@Kim-Jaemin420
Copy link
Contributor Author

@HY219 님! 저도 생각해보니 imageId가 애초에 number 타입으로 지정하면 좋지 않을까 해서 찾아보니, url params는 기본적으로 문자열로 처리되어 어쩔 수 없이 string 타입으로 지정해야 하는 것 같습니다ㅠ

Copy link
Contributor

@yjc2021 yjc2021 left a comment

Choose a reason for hiding this comment

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

LGTM 수고하셨습니다!

@Kim-Jaemin420 Kim-Jaemin420 merged commit 75ef2e4 into main Mar 4, 2024
3 checks passed
@Kim-Jaemin420 Kim-Jaemin420 deleted the #92/chore/router-type branch March 4, 2024 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚙ Chore 설정 파일 변경 및 주석 제거
Projects
None yet
Development

Successfully merging this pull request may close these issues.

router type 선언 및 router devtools, tanstack query devtools 추가
4 participants