mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-03-18 06:08:22 +03:00
useResizeObserver reads ref.current at render time; on page refresh with fast SWR cache, no re-render occurs after mount so ref.current remains null in the effect, observation never starts, and containerWidth stays 0 forever. Add a useLayoutEffect that measures offsetWidth synchronously before paint as a seed value (effectiveWidth = containerWidth || initialWidth). Once ResizeObserver fires normally, containerWidth takes over. The Responsive grid is gated on effectiveWidth > 0 so it always renders correctly on both first load and refresh. https://claude.ai/code/session_01H1sqbcFmtwwsdNTJcJHJWd |
||
|---|---|---|
| .. | ||
| button | ||
| classification | ||
| events | ||
| explore | ||
| live | ||
| motion-search | ||
| recording | ||
| search | ||
| settings | ||
| system | ||