code review

lazy corder·2022년 4월 24일
1
  1. state 하나로 관리하기
  2. 유효성 검사
  3. 컴포넌트 분리
  4. variables

state관리

 const handleInput = e => {
    const { name, value } = e.target;
    setInputValues(inputValues => ({ ...inputValues, [name]: value }));
  };

구조분해할당

const { name } = e.target;
// e.target이 name에 할당됨
const { name, value } = e.target;
// id 
// 123123123

유효성 검사

state 아닌 변수로도 관리 가능

0개의 댓글