-
[12]setState()의 인수로서 콜백 함수의 목적dev/Web 2021. 4. 12. 19:03
setState의 콜백 기능은 setState가 완료되고 구성요소가 렌더링 될때 호출된다.
이 콜백함수는 비동기식으로 작동한다.
- 콜백 기능보다는 라이프 사이클 API를 사용하는 방식이 더 좋다.
'dev > Web' 카테고리의 다른 글
[14]JSX 콜백에서 메서드 또는 이벤트 핸들러를 바인딩하는 방법 (0) 2021.04.12 [13]HTML과 React 이벤트 처리의 차이점 (0) 2021.04.12 [11]State를 직접적으로 업데이트 하면 안되는 이유 (0) 2021.04.12 [10]State와 Props의 차이 (0) 2021.04.12 [9]React에서 Prop은 무엇인가? (0) 2021.04.12