-
Notifications
You must be signed in to change notification settings - Fork 31
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
React 김재욱 #138
The head ref may contain hidden characters: "react-\uAE40\uC7AC\uC6B1"
React 김재욱 #138
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.
전반적으로 컴포넌트 단위로 잘 쪼개주신 것 같습니다!
page 폴더 하위에 컴포넌트 단위로 css와 jsx 파일 구분해 주신 점도 아주 좋습니다.
과제 진행하느라 고생 많으셨습니다!
<div onClick={() => (window.location.href = "/privacy")}> | ||
Privacy Policy | ||
</div> | ||
<div onClick={() => (window.location.href = "/faq")}>FAQ</div> |
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.
리액트를 사용해 보고 계시니 js 기본 기능이 아닌 link
를 사용해보시는건 어떨까요?
link
useEffect(() => { | ||
const fetchData = async () => { | ||
const newBestProducts = await getProductsList(1, 4, "favorite", ""); | ||
setBestProductsState(newBestProducts); | ||
}; | ||
|
||
fetchData(); | ||
}, []); |
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.
getProductsList
변수를 하드 코딩이 아닌 다른 방식으로 처리해 보시는건 어떨까요?
@@ -0,0 +1,32 @@ | |||
// eslint-disable-next-line react/prop-types |
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.
eslint 여기서 비활성화 하신 이유가 있을까요? react/prop-types
가 발생하는게 부담스러운 경우 eslint.config.js
에서 비활성화 해 주시는게 더 좋습니다!
src={product.images[0]} | ||
alt={product.name} |
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.
이미지가 없는 경우 product.images[0]
는 어떻게 될까요? 방어코드가 추가되면 더욱 좋을 것 같습니다!
const keyPressHandler = (e) => { | ||
if (e.key === "Enter") { | ||
setSearchByState(searchByInputState); | ||
} | ||
}; |
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.
enter를 눌렀을 때만 검색되도록 작업하신 점 훌륭합니다! 매 입력시 API를 호출한다면 서버에도 부담이 많이 되겠죠.
다만 현 코드에서 유저가 enter를 입력해야 검색이 된다는 것을 알 수 있을까요? 유저에게 인지시킬 방법이 있는지 생각해 보면 좋을 것 같습니다!
dc9fb6c
into
codeit-sprint-fullstack:react-김재욱
요구사항
기본
심화
주요 변경사항
스크린샷
멘토에게