"use client"; import { useSyncExternalStore } from "react"; // FALSE on the server and through hydration, TRUE from the first client render // after it. The house rule (components/VerdictChip.tsx): a button is disabled // until this is true, because a click that lands before React hydrates fires // nothing at all -- no request, no error -- and an action lost that way looks // like one never taken. const subscribe = () => () => {}; export function useHydrated(): boolean { return useSyncExternalStore( subscribe, () => true, () => false, ); }