개발일기장
react componentwillunmount 이거 어떻게 할까 본문
728x90
Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method. 오류가 뜨는데 음 구독중인거랑 동기화?하는일을 취소해라고 함
자꾸 이게 뜨는데 해결방법을 잘 모르겠어서 찾는중임
1.chat에 연결된 이벤트를 unmount할때 다 지우기
2.MainPage에서 unmount할때 chat을 지우기
모르겠다
728x90
'React.js' 카테고리의 다른 글
Rechart Data 동적으로 추가 (0) | 2021.07.12 |
---|---|
Recharts simpleLineChart - type (0) | 2021.07.12 |
react & babel & webpack (0) | 2020.01.22 |
리엑트에서 socket.io 의 state바꾸기 방법 (0) | 2020.01.17 |
Socket.io-client 부분 {transports : polling } 옵션 (0) | 2020.01.15 |
Comments