Fix linting

This commit is contained in:
yangdx
2025-04-07 06:20:48 +08:00
parent 4dcb266adf
commit 56865816f1
3 changed files with 18 additions and 18 deletions

View File

@@ -35,18 +35,18 @@ function App() {
// Track component mount status with useRef
const isMountedRef = useRef(true);
// Set up mount/unmount status tracking
useEffect(() => {
isMountedRef.current = true;
// Handle page reload/unload
const handleBeforeUnload = () => {
isMountedRef.current = false;
};
window.addEventListener('beforeunload', handleBeforeUnload);
return () => {
isMountedRef.current = false;
window.removeEventListener('beforeunload', handleBeforeUnload);