-
Notifications
You must be signed in to change notification settings - Fork 79
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
[이종욱] Sprint12 #736
The head ref may contain hidden characters: "Next.js-\uC774\uC885\uC6B1-sprint12"
[이종욱] Sprint12 #736
Conversation
기존 Next.js 프로젝트 내 제품 페이지가 존재하지 않아, 기존 페이지를 맞게 컨버팅한 후 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.
과제하느라 고생하셨습니다 👍
page = 1, | ||
pageSize = 3, | ||
orderBy = "recent", | ||
keyword, |
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.
keyword 타입이 널러블이여서 undefined가 들어올 수도 있을 것 같은데, keyword 타입을 명시해주시거나 빈문자열로 초기화해주시는 것도 좋을 것 같습니다.
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.
저는 개인적으로 class 내부에 미디어쿼리를 넣는 방법을 선호합니다. 이렇게 하면 유지보수하는 시점에 수정해야하는 클래스 하나를 찾고 내부의 반응형 css를 수정해줄 수 있기 때문입니다!
@@ -0,0 +1,139 @@ | |||
import { useEffect, useState } from "react"; | |||
import { sortItemsByOrder } from "../../lib/sort"; |
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.
alias path 도입해보시는것도 추천드려요!
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; | ||
|
||
function AllItems() { | ||
const [order, setOrder] = useState<ProductSortOption>("recent"); |
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.
recent 같은 값은 상수로 활용해보시는 것을 추천드립니다.
isPending, | ||
isError, | ||
} = useQuery({ | ||
queryKey: ["allitems"], |
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.
queryKey에 상태값도 포함해주셔야 다른 상태를 불러올때 캐싱된 값을 불러오지 않고 새롭게 요청을 보낼 수 있습니다.
} | ||
|
||
function BestProducts({ items, counts }: { items: Product[]; counts: number }) { | ||
console.log(items); |
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.
console.log 지워주시면 좋을 것 같습니다.
요구사항
기본
주요 변경사항
스크린샷
멘토에게