UNPKG

@tanstack/react-db

Version:

React integration for @tanstack/db

17 lines (16 loc) 463 B
"use client"; import { useRef } from "react"; import { useDbClient } from "./DbProvider.js"; function HydrationBoundary({ state, children }) { const client = useDbClient(); const hydrated = useRef(void 0); if (hydrated.current?.client !== client || hydrated.current.state !== state) { client.hydrate(state); hydrated.current = { client, state }; } return children; } export { HydrationBoundary }; //# sourceMappingURL=HydrationBoundary.js.map