-
카테고리
-
세부 분야
프론트엔드
-
해결 여부
미해결
useEffect 질문있습니다.
21.01.09 18:18 작성 조회수 124
0
useEffect(() => { // componentDidMount, componentDidUpdate = 합쳐놓았다고 생각
console.log('랜덤')
interval.current = setInterval(changeHand, 100)
return () => { // componentWillUnmount
console.log('랜덤종료')
clearInterval(interval.current)
}
}, [imgCoord]) // componentDidUpdate
componentwillMount가 헷갈리는게
componentDidMount, componentDidUpdate 이후에 바로 실행이 되는건가요~?
아니면 componentDidUpdate가 되면서 기존 컴포넌트가 리렌더링 될 때 일어나나요? 궁금합니다.
답변을 작성해보세요.
답변 2