In the context of React development, what is the recommended approach to resolve the issue of "can't perform a react state update on an unmounted component" and prevent potential memory leaks?
A) Use 'componentDidUpdate' to handle state updates.
B) Implement error boundaries to catch unmounted component errors.
C) Cancel all subscriptions and asynchronous tasks in a 'useEffect' cleanup function.
D) Increase the 'timeout' setting for asynchronous tasks.