mirror of
https://github.com/supabase/supabase.git
synced 2026-10-10 20:05:06 +03:00
\`readReplicas\` was a fresh array reference every render (\`databases.filter(...)\` without \`useMemo\`). The polling useEffect deps \`[isDatabasesSuccess, readReplicas]\` were therefore unstable, the effect ran every render, and the \`setStatusRefetchInterval\` write churn kept the parent re-rendering. That alone wouldn't normally break — React bails out on same-value setState — but it kept the Tooltip parent re-rendering in a tight loop, which trips a latent bug in @radix-ui/react-slot 1.2.x: Slot's render uses plain \`composeRefs(forwardedRef, childrenRef)\` instead of \`useComposedRefs\`, so each render produces a new ref function. React replaces the ref each time, calls oldFn(null) → newFn(node), which propagates to the Tooltip's \`useState(setTrigger)\` ref and flips state null↔node forever until React trips the max-update-depth guard. Stable parent → stable Slot ref → no loop. Mirrors what ReplicationDiagram.tsx already does for the same field. Surfaces under TanStack Start because our route shells re-render more frequently than Next's getLayout pipeline; the underlying Slot bug is React-version-agnostic but the timing under TanStack tips this page over.