UNPKG

@tanstack/react-router

Version:

Modern and scalable routing for React applications

18 lines (17 loc) 674 B
import { Await } from "../awaited.js"; import { RouterProvider } from "../RouterProvider.js"; import { jsx } from "react/jsx-runtime"; import { hydrate } from "@tanstack/router-core/ssr/client"; //#region src/ssr/RouterClient.tsx var hydrationPromise; function RouterClient(props) { if (!hydrationPromise) if (!props.router.stores.matchesId.state.length) hydrationPromise = hydrate(props.router); else hydrationPromise = Promise.resolve(); return /* @__PURE__ */ jsx(Await, { promise: hydrationPromise, children: () => /* @__PURE__ */ jsx(RouterProvider, { router: props.router }) }); } //#endregion export { RouterClient }; //# sourceMappingURL=RouterClient.js.map