Separate Client Portal & Dashboard
This commit is contained in:
16
frontend/dashboard/src/hooks/useIsMountedRef.ts
Normal file
16
frontend/dashboard/src/hooks/useIsMountedRef.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { useRef, useEffect } from 'react';
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
export default function useIsMountedRef() {
|
||||
const isMounted = useRef(true);
|
||||
|
||||
useEffect(
|
||||
() => () => {
|
||||
isMounted.current = false;
|
||||
},
|
||||
[]
|
||||
);
|
||||
|
||||
return isMounted;
|
||||
}
|
||||
Reference in New Issue
Block a user