
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
- button
- useState
- useReducer
- yaml
- custom hooks
- zoom
- 리액트
- React Native
- background-attachment
- bind
- withcredentials
- CORS
- React Hooks
- 상태관리
- javascript
- 스크롤
- useMemo
- touchableopacity
- jenv
- 고정
- useRef
- React
- window.location
- jdk
- Pressable
- yml
- css
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
글 보관함
반응형