mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2025-12-10 18:26:37 +00:00
feat: add option to disable ui warnings
This commit is contained in:
@@ -1,15 +0,0 @@
|
||||
import { useCallback, useEffect, useRef } from "react";
|
||||
|
||||
export function useIsMounted(): () => boolean {
|
||||
const isMounted = useRef(false);
|
||||
|
||||
useEffect(() => {
|
||||
isMounted.current = true;
|
||||
|
||||
return () => {
|
||||
isMounted.current = false;
|
||||
};
|
||||
}, []);
|
||||
|
||||
return useCallback(() => isMounted.current, []);
|
||||
}
|
||||
Reference in New Issue
Block a user