-
Notifications
You must be signed in to change notification settings - Fork 43
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
[박준환] sprint8 #279
base: React-박준환
Are you sure you want to change the base?
The head ref may contain hidden characters: "React-\uBC15\uC900\uD658-sprint8"
[박준환] sprint8 #279
Conversation
import "./Header.css"; | ||
|
||
// react-router-dom의 NavLink를 이용하면 활성화된 네비게이션 항목을 하이라이트해줄 수 있어요! | ||
function getLinkStyle({ isActive }: { isActive: boolean }) { |
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.
function getLinkStyle({ isActive }: { isActive: boolean }) { | |
function getLinkStyle(isActive: boolean) { |
으로 간결하게 쓸 수 있을 거 같아요!
setIsDropdownVisible(false); | ||
}} | ||
> | ||
최신순 |
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.
타입스크립트로 바꾸시는 김에 <최신순>, <인기순> 도 타입화해보시면 좋을 거 같아요!
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.
아직 확장자만 ts 이고, 실제 타입스크립트를 적용한 부분이 많지 않아서 간략하게 리뷰했습니다~
onClick={() => { | ||
onSortSelection("favorite"); | ||
setIsDropdownVisible(false); | ||
}} |
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.
렌더부에서 넣어줄 값이 없는 경우에는 해당 값을 따로 함수로 빼서 넣어주시는 걸 추천드려요!
const handleItemClick = () => {
onSortSelection("favorite");
setIsDropdownVisible(false);
}
onClick={() => { | |
onSortSelection("favorite"); | |
setIsDropdownVisible(false); | |
}} | |
onClick={handleItemClick} |
size, | ||
fillColor, | ||
outlineColor, |
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.
요런 친구들도 props 인 경우는 타입 써주시는 게 좋습니다!
function AddItemPage() { | ||
const [name, setName] = useState(""); | ||
const [description, setDescription] = useState(""); | ||
const [price, setPrice] = useState(""); |
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.
price 의 경우 숫자라고 생각이 드는데 초기값이 "" 라서 타입병기해주시면 좋을 거 같아요!
const [price, setPrice] = useState(""); | |
const [price, setPrice] = useState<string>(""); |
const [name, setName] = useState(""); | ||
const [description, setDescription] = useState(""); | ||
const [price, setPrice] = useState(""); | ||
const [tags, setTags] = useState([]); |
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.
배열의 경우에도 안에 어떤 값이 올 지 적어주심 좋아요!
const [tags, setTags] = useState([]); | |
const [tags, setTags] = useState<Array<string>>([]); |
요구사항
기본
심화
주요 변경사항
스크린샷
멘토에게