-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[장준혁] Sprint12 #721
The head ref may contain hidden characters: "React-\uC7A5\uC900\uD601-sprint12"
[장준혁] Sprint12 #721
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.
진짜로 잘하시는데요..
아직 좀 더 봐야겠지만 제가 뭐 코드리뷰 막 달아드릴만한 것도 없을정도로!
axios 도 많이 사용하고 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.
우선 질문에 답을 먼저 하자면,
axios 사용 너무너무 좋아합니다 react-query가 있더라도 axios 많이 사용합니다!
interceptor라는 기능 자체가 너무 유용하기도 하구요 👍
const refreshToken = localStorage.getItem('refreshToken'); | ||
try { | ||
const response = await axios.post( | ||
`${process.env.REACT_APP_API_URL}/auth/refresh-token`, |
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.
보통 BASE_URL까지 빼는데 이것은 정석이네요 👍 굿굿
const isButtonDisabled = comment.trim() === ''; | ||
const onSubmit: SubmitHandler<Inputs> = (data) => { | ||
mutationComment.mutate(data.comment); | ||
}; | ||
|
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.
로딩중이거나 api를 fetch하는 중일 때의 얼리 리턴이 필요합니다!
|
||
useEffect(() => { | ||
const fetchUserId = async () => { | ||
const response = await axiosInstance.get('/users/me'); |
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.
await axiosInstance.get('/users/me'); 같은 부분들도 함수로 추출할 수 있곘져
예를 들면
async function fetchMe() {await axiosInstace.get("~~")}
// ItemIntroduction.tsx
const response = await fetchMe()
요구사항
기본
중고마켓
상품 상세
상품 등록
주요 변경사항
스크린샷
스프린트미션 12 배포 사이트
멘토에게