Closed eddielee394 closed 5 years ago
The issue turned out to revolve around RN's stack based navigation and the fact that components aren't actually unmounted when navigated from. So adding a cleanup function in the useEffect
hook didn't ever trigger.
When the
setTimeout
method starts running it doesn't get cleared when the component unmounts, causing a significant memory leak. If an empty array is passed as a dependency to the hook, the timeout only triggers once and then stops. attempted to run a cleanup function so that the timeout is cleared on unmount, but the timerID keeps changing (hence the timer never being cleared). Need to resolve exactly how to handle disabling a timeout when the component unmounts.