What is the purpose of the componentWillUnmount method in React Native?
The componentWillUnmount method in React Native is called just before the component is removed from the DOM and destroyed. It is often used to perform cleanup tasks such as unsubscribing from external events or clearing timers.