Author Archives: Thanh Tùng

Cleanup asynchronous tasks in React

By | September 26, 2020

If you are a React developer, you might see this error: Warning: Can’t call setState (or forceUpdate) 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. In React, components maintain their own state during its… Read More »