개발일기장

react componentwillunmount 이거 어떻게 할까 본문

React.js

react componentwillunmount 이거 어떻게 할까

게슬 2020. 1. 15. 10:35
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을 지우기 

(참고한거 : https://stackoverflow.com/questions/52061476/cancel-all-subscriptions-and-asyncs-in-the-componentwillunmount-method-how)

 

 모르겠다

 

 

728x90
Comments