fix: remove isMounted from useEffect dependencies

- isMounted is a stable function from useMountedState and shouldn't be in deps
- Including it was preventing effects from running correctly
- Fixes issue where articles wouldn't load (stuck on spinner)
This commit is contained in:
Gigi
2025-10-20 17:46:41 +02:00
parent 627ffd6c5d
commit b117b1e6cf
2 changed files with 4 additions and 2 deletions

View File

@@ -116,6 +116,7 @@ export function useArticleLoader({
loadArticle()
// Intentionally excluding setter functions from dependencies to prevent race conditions
// isMounted is a stable function and doesn't need to be in dependencies
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [naddr, relayPool, settings, isMounted])
}, [naddr, relayPool, settings])
}

View File

@@ -150,8 +150,9 @@ export function useExternalUrlLoader({
loadExternalUrl()
// Intentionally excluding setter functions from dependencies to prevent race conditions
// isMounted is a stable function and doesn't need to be in dependencies
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [url, relayPool, eventStore, cachedUrlHighlights, isMounted])
}, [url, relayPool, eventStore, cachedUrlHighlights])
// Keep UI highlights synced with cached store updates without reloading content
useEffect(() => {