Skip to content

Commit 39f08ea

Browse files
committed
Add clearTimeOut to unload async function when ErrorContainer is unmounted
1 parent 4d21b0c commit 39f08ea

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/app/containers/ErrorContainer.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ function ErrorContainer(): any {
6565
if (loadingArray[1] === false && status.reactDevToolsInstalled === true) {
6666
setLoadingArray(2, false);
6767
}
68+
69+
//Unload async function when Error Container is unmounted
70+
return () => {
71+
clearTimeout(timeout.current);
72+
};
6873
}, [status, currentTitle, timeout, loadingArray]);
6974

7075
return (

0 commit comments

Comments
 (0)