-
Notifications
You must be signed in to change notification settings - Fork 2
[#57] ✨ 공통 컴포넌트 TextArea 구현 #110
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
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.
가독성이 좋고 재사용성이 뛰어나게 보이네요. 아토믹한 디자인을 잘 이해하고 계신 것 같아요 !
다만 text input 에서 처럼 훅폼과 같이 쓸 수 있게, register props를 내려주는 것이 좋아보입니다 !
유효성 검사 (글자 100자 제한) 등을 어겼을 때, 에러 스타일이 나타날 수 있게 처리 해주는 것도 좋아보이구요
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.
저도 방금 찾아봐서 처음 알았는데, 또한 forward ref 등록이 훅 폼의 모든 기능을 활용할 수 있게 한다고 하네요
const MyInput = forwardRef<HTMLInputElement, MyInputProps>(
({ label, ...rest }, ref) => {
return (
<label className='flex flex-col'>
<span>{label}</span>
<input ref={ref} {...rest} />
</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.
좋은 리뷰 감사합니다 ㅎㅎㅎ
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.
훅 폼 사용을 위한 register prop 좋네요..!!
yellowjang
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.
제가 공통 컨포넌트를 건들이지 않다보니 css 사용이 낯선데, 코드 보면서 많이 배웠습니다.
고생하셨습니다!
| const textAreaClass = twMerge( | ||
| baseStyles, | ||
| clsx( | ||
| { | ||
| 'w-full': fullWidth, | ||
| 'h-104': size === 'md', | ||
| 'h-140': size === 'lg', | ||
| }, | ||
| className | ||
| ) | ||
| ) |
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.
css에 관한 것도 이렇게 복잡하군요 .... 대단합니다
📌 PR 템플릿
🏷️ PR 타입 (PR Type)
📝 요약 (Summary)
🔍 상세 내용 (Describe your changes)
TextArea컴포넌트 구현TextAreaAutoResized->TextArea로 변경invalid스타일링 처리TextInputforwardRef로 리팩토링 -> 기존 register prop 제거🔗 관련 이슈 또는 링크 (Issue Number or Link)
✅ 체크리스트 (Checklist)
📸 스크린샷 (선택 사항)
2024-11-19.10.56.52.mov
invalid prop (추가된 prop이라 이미지로 첨부)
📝 기타 사항
TextArea의 컴포넌트의 사이즈가 3개로 분리가 되어 sm, md, lg로 진행했는데...! 어떠신지 의견 부탁드려용