-
Notifications
You must be signed in to change notification settings - Fork 44
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
[정지성]Week15 #473
The head ref may contain hidden characters: "part3-\uC815\uC9C0\uC131-week15"
[정지성]Week15 #473
Conversation
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.
페어프로그래밍 했던 부분 복기 해보셨을까요?
고생하셨습니다 👏
<Navigation /> | ||
<Addlink /> | ||
<PageDisplay> | ||
<button onClick={handleLogout}>로그아웃</button> |
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.
로그아웃 기능도 구현해주셨네요 👏
if (typeof param !== 'string') { | ||
return; | ||
} |
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.
요거 제가 이렇게 처리하긴 했지만 타입 가드를 이용해서 더 깔끔하게 처리할 수 있으니 참고해보세요~
// util
const isStringQuery = (value: unknown): value is string => {
return typeof value === 'string';
}
// hook
const useRouterQuery = (segmentName: string) => {
const { query } = useRouter();
const segment = query[segmentName];
if (!isStringQuery(segment)) {
return;
}
return segment;
}
그냥 코멘트로 남기는 코드라 동작이 되는지는 모르겠네요.. ㅎㅎ 한번 확인해보시고 수정해서 적용해보세요~
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.
index 와 folderId 페이지로 나눠주신 이유가 있나용?
파일명 컨벤션 중에 optional 로 segment 값을 받을 수 있는게 있습니다. 요걸로 하나의 페이지로 작업해볼 수 있을 것 같습니다!
https://nextjs.org/docs/pages/building-your-application/routing/dynamic-routes#optional-catch-all-segments
// const card = useFetch<{ data: Link[] }>(url); | ||
// const cardData = card?.data; |
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.
앗 불필요한 주석은 삭제해주세요~
@@ -25,22 +26,33 @@ interface Card { | |||
description: string; | |||
} | |||
interface Folder { | |||
id: string; | |||
id: string | number; |
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.
number 도 허용하는 이유가 있을까요?
하나로 통일해서 처리할 수 있으면 그렇게 하는게 좋을 것 같습니다.
요구사항
기본
심화
주요 변경사항
스크린샷
https://5-weekly-mission-3rhozkw8o-byukchongs-projects.vercel.app
멘토에게