![](http://i1.daumcdn.net/thumb/C148x148.fwebp.q85/?fname=https://blog.kakaocdn.net/dn/br6QYe/btr1UVjoBno/CZqfEkQc0xRF5gJti5qzMk/img.png)
1. useState리액트에서 상태관리라고 하면, 가장 먼저 떠오르는 hooks 중 하나로 useState를 뽑을 수 있다.컴포넌트에서 state를 동적으로 관리하기 위해서 자주 사용되는 함수이다.// 사용방법const [state, setState] = useState(initialState);// 예시const [name, setName] = useState("");// 초기값console.log(name); // ''// name state 재할당setName("박레고");// 랜더링 이후console.log(name); // 박레고setName함수를 통해 name의 값을 변경해줄 수 있다. setName은 상태 값을 갱신해주는 Setter 함수라고 한다. 2. useReducer그렇다면, us..
React
2023. 3. 5. 19:11
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- this
- useMemo
- bind
- css
- withcredentials
- 고정
- button
- React
- touchableopacity
- javascript
- useState
- jenv
- custom hooks
- background-attachment
- yaml
- React Hooks
- 스크롤
- Pressable
- useRef
- 리액트
- yml
- jdk
- React Native
- useReducer
- 상태관리
- window.location
- zoom
- CORS
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
글 보관함
반응형