일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- 리터럴 타입
- 태그된 유니온
- 타입 좁히기
- dfs
- 투포인터
- Promise
- 반공변성
- async/await
- 공변성
- CORS
- app router
- Cypress
- recoil
- 무한 스크롤
- 이분 검색
- webpack
- map
- tailwind
- React
- autosize
- ESlint
- RTK Query
- 호이스팅
- TS
- useAppDispatch
- 인터섹션
- CI/CD
- 결정 알고리즘
- SSR
- Jest
Archives
- Today
- Total
목록제어 컴포넌트 (1)
짧은코딩
제어, 비제어 컴포넌트
제어 컴포넌트폼 데이터가 React 컴포넌트의 state에 의해 제어상태(state)와 입력 필드가 동기화-예시 코드function ControlledInput() { const [value, setValue] = useState(''); return ( setValue(e.target.value)} /> );}상태 변경 시 컴포넌트 리렌더링반응형 상태 관리비제어 컴포넌트DOM 자체에서 폼 데이터를 다룸ref를 사용해 DOM 요소에 직접 접근-예시 코드function UncontrolledInput() { const inputRef = useRef(null); const handleSubmit = () => { console.log(inputRef.current.val..
개발
2025. 3. 28. 20:01