-
Notifications
You must be signed in to change notification settings - Fork 35
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 #192
The head ref may contain hidden characters: "React-\uC815\uC6D0\uC2DD-Sprint6"
[정원식] Sprint6 #192
Conversation
function AddItems() { | ||
const [values, setValues] = useState(INITIAL_VALUES); | ||
const [initialPreview, setInitialPreview] = useState(undefined); |
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.
setInitialPreview
가 사용되지 않고 있어요. 그래서 이 라인을 지우고 ImageFileInput
컴포넌트에서 preview
상태의 초깃값을 undefined로 해주면 될 것 같습니다.
function ImageFileInput({ | ||
className = '', | ||
name, | ||
value, |
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.
value
보다는 어떤 상세한 변수명이 좋을 것 같습니다. 컴포넌트를 들여다 봤을때 이미지를 뜻하는거니까 productImage
와 같이 좀 더 자세한 변수명을 사용해주세요.
<> | ||
<div className="card-input-image-file"> | ||
<img | ||
src={preview || ImgDeafault} |
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.
디폴트 이미지 사용해주신 점 아주 좋습니다 !
<div className="wrapper-form-add-item"> | ||
<form className="form-add-item" onSubmit={handleSubmit}> | ||
<div className="wrapper-input-form-add-item"> | ||
<label className="title-input-form-add-item">상품 이미지</label> |
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.
일반적인 제목을 나타낼 의도라면 p
태그가 좀 더 적절하겠습니다 ㅎㅎ
if (!values.tags.includes(tag)) { | ||
handleChange( | ||
'tags', | ||
values.tags.length > 0 ? [...values.tags, tag] : [tag] |
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.
불변성을 잘 지켜주셨네요 !!
<Button | ||
text="등록" | ||
onClick={handleSubmit} | ||
isDisabled={!isAllValid} | ||
/> |
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.
submit
역할을 하는 버튼이므로 form
태그 안에 위치하는게 어떨까요?
스프린트 미션 수고하셨습니다 !! |
요구사항[기본]
요구사항 [심화] [심화]
스크린샷
배포