Input 컴포넌트 #33
dldnlee
started this conversation in
커스텀훅 / 유틸함수
Replies: 1 comment
-
InputComponent 수정본Input 컴포넌트 수정을 하였습니다. 수정 내용
수정된 코드
<input
id="email-input"
type="email"
className="w-full h-48pxr py-0 px-10pxr bg-gray_150 rounded-md focus:outline-primary mb-30pxr"
placeholder="이메일을 입력해주세요"
value={emailValue}
<label />
<input />
const labelFocusWithin = 'text-black';
const labelFocusWithout = 'text-gray-500';
function useInputMapping({
const [emailValue, setEmailValue] = useState('');
<label
htmlFor="email-input"
className={`mb-8pxr ml-2pxr text-foot-em ${isEmailFocused ? labelFocusWithin : labelFocusWithout}`}
>
이메일
</label>
<input
id="email-input"
type="email"
className="w-full h-48pxr py-0 px-10pxr bg-gray_150 rounded-md focus:outline-primary mb-30pxr"
placeholder="이메일을 입력해주세요"
value={emailValue}
onChange={handleEmailChange}
onFocus={() => setIsEmailFocused(true)}
onBlur={() => setIsEmailFocused(false)}
/> |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
사용법:
호출 예시
사용 가능한 옵션
폼에 따른 validation 기능 내장돼있음
atom만들때
passwordAtom
이름으로 지키기(placeholder props 필수)
Beta Was this translation helpful? Give feedback.
All reactions