-
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
[이석찬] Sprint6 #237
The head ref may contain hidden characters: "React-\uC774\uC11D\uCC2C-sprint6"
[이석찬] Sprint6 #237
Conversation
…ithub-actions [Fix] delete merged branch github action
package-lock.json 위 파일들의 충돌이 자꾸 발생한다고 깃에서 경고 문구가 뜨는데 로컬파일에서는 따로 충돌이 보이지 않아 어떻게 해결해야될지 모르겠습니다 ㅠ |
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.
package-lock.json
package.json
public/index.html
src/index.js위 파일들의 충돌이 자꾸 발생한다고 깃에서 경고 문구가 뜨는데 로컬파일에서는 따로 충돌이 보이지 않아 어떻게 해결해야될지 모르겠습니다 ㅠ
해당 부분 고민해보시다가 다음 멘토링까지 안되시면 질문주시면 실시간으로 같이 해결해봐요!
const [input, setInput] = useState(""); | ||
|
||
const onPressEnter = (event) => { | ||
if (event.nativeEvent.isComposing) 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.
👍
|
||
function ItemCard({ item, imgSizeClass }) { | ||
const imageUrl = | ||
item.images && item.images.length > 0 ? item.images[0] : defaultImage; |
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.
요런 문법도 써보면 재밌어요!
item.images && item.images.length > 0 ? item.images[0] : defaultImage; | |
item?.images?.[0] ?? defaultImage; |
const sortedItems = [...items].sort((a, b) => { | ||
if (sortType === "newest") { | ||
return new Date(b.createdAt) - new Date(a.createdAt); | ||
} | ||
if (sortType === "favorite") { | ||
return b.favoriteCount - a.favoriteCount; | ||
} | ||
return 0; | ||
}); |
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.
spread 연산자의 세심함...👍 early return 도 좋습니다!
function AddItem() { | ||
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 가 string 타입이네요..!
try { | ||
const data = await getItems(); | ||
setItems(data); | ||
setLoading(false); | ||
} catch (err) { | ||
setError(err.message); | ||
setLoading(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.
setLoading 은 api 의 에러 여부와 관계없이 처리되는 값이라서 finally 로 받아주는 게 자연스러울 거 같아요!
try { | |
const data = await getItems(); | |
setItems(data); | |
setLoading(false); | |
} catch (err) { | |
setError(err.message); | |
setLoading(false); | |
} | |
try { | |
const data = await getItems(); | |
setItems(data); | |
} catch (err) { | |
setError(err.message); | |
} finally { | |
setLoading(false); | |
} |
요구사항
체크리스트 [기본]
상품 등록
심화
주요 변경사항
스크린샷
멘토에게