mirror of
https://github.com/dergigi/boris.git
synced 2025-12-17 22:54:30 +01:00
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:
@@ -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])
|
||||
}
|
||||
|
||||
@@ -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(() => {
|
||||
|
||||
Reference in New Issue
Block a user