Don't reference window outside useEffect or click event.

This commit is contained in:
James Grugett 2022-08-10 12:05:52 -05:00
parent 52a2a3d842
commit 05c9d3513a

View File

@ -329,7 +329,7 @@ function GroupsList(props: {
const { height } = useWindowSize() const { height } = useWindowSize()
const [containerRef, setContainerRef] = useState<HTMLDivElement | null>(null) const [containerRef, setContainerRef] = useState<HTMLDivElement | null>(null)
const remainingHeight = const remainingHeight =
(height ?? window.innerHeight) - (containerRef?.offsetTop ?? 0) (height ?? 0) - (containerRef?.offsetTop ?? 0)
const notifIsForThisItem = useMemo( const notifIsForThisItem = useMemo(
() => (itemHref: string) => () => (itemHref: string) =>