-
Notifications
You must be signed in to change notification settings - Fork 2
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!!!!🚀🚀🚀 덕분에 경로 설정 편해지겠네요 👍🏻
There was a problem hiding this 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"; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import 사이에 개행 추가하신 이유가 있는지 궁금합니다 :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
devtools 추가/삭제하다 보니 실수했네요! 감사합니다ㅎㅎ
@HY219 님! 저도 생각해보니 imageId가 애초에 number 타입으로 지정하면 좋지 않을까 해서 찾아보니, url params는 기본적으로 문자열로 처리되어 어쩔 수 없이 string 타입으로 지정해야 하는 것 같습니다ㅠ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 수고하셨습니다!
📝 작업 내용
Link, navigate의 path 타입을 추론할 수 있도록 router type 선언해주었습니다. Link 작성시 아래처럼 자동완성이 됩니다.
react query devtools와 tanstack router devtools를 설치하고 적용했습니다.
+) Link 타입을 적용하면서 타입이 맞지 않는 것들을 타입에 맞도록 수정해주었습니다.
close #92