-
Notifications
You must be signed in to change notification settings - Fork 39
[문주영] Sprint6 #220
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 #220
The head ref may contain hidden characters: "React-\uBB38\uC8FC\uC601-sprint6"
Conversation
useEffect 사용
닫히는 방식을 blur에서 click 이벤트로 변경, option 순회 및 input type="button" 추가
GANGYIKIM
left a 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.
주영님 6번째 미션 작업 고생하셨습니다~
제가 코드를 만져보니 몇가지 아쉬운 점들이 있어요. 코멘트 드린 부분 외에도 첨언하자면 등록 버튼 활성화 로직이 요구사항과 다르게 구현되어 있습니다. 태그 인풋에 값이 있을때가 아니라 생성된 태그가 있을시를 확인하셔야 합니다.
추후 시간이 되실때 태그 추가를 구현하시면서 해당 부분도 다시 보시면 좋겠습니다.
다음 미션도 화이팅입니다~
| <img src={icX} /> | ||
| </button> | ||
| </section>} | ||
| <input id="file" name="file" type="file" accept="image/*" onChange={handleChange} disabled={itemImage} /> |
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.
💊 제안
input의 accept 속성은 유저가 어떤 파일을 올려야하는지에 대한 힌트를 제공하는 속성입니다.
유저는 파일 업로드시 accept의 명시된 확장자 이외의 파일도 올릴 수 있으므로
실제 upload 함수에서 한번더 확장자를 검사해주시는 것이 좋습니다.
(사용자가 업로드창에서 옵션을 열어 확장자를 바꾸면 아래처럼 보입니다)

https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/accept
| <button className="eye-btn" type="button" onClick={onClick}> | ||
| <img src={isVisible ? icEyeVisible : icEyeInvisible} /> | ||
| </button> | ||
| function Input ({ label, name, className, inputClassName, type, children, ...props }) { |
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.
💊 제안
input 과 textarea 두개의 컴포넌트로 나누시는 게 더 명확하고 좋을 것 같아요.
지금과 같은 구조에서는 textarea의 경우 필요없는 prop을 받아야하고 이로인해 명확성도 떨어지는 것 같아요.
특히 type의 경우 input에서는 input 태그의 type 속성이고 Input 컴포넌트에서는 textarea 이거나 input 태그의 type 속성 이라 더 모호한 것 같아요~
요구사항
기본
심화
주요 변경사항
스크린샷
멘토에게