Server: Phase 2 (REVIEW not respected yet)
This commit is contained in:
1 parent
5d16ded553
commit
142b47674d
4271 files changed
+1203269
No files matched your search
+50
@@ -0,0 +1,50 @@
|
||||
"use client";
|
||||
const require_runtime = require("./_virtual/_rolldown/runtime.cjs");
|
||||
const require_routerContext = require("./routerContext.cjs");
|
||||
const require_Matches = require("./Matches.cjs");
|
||||
let _tanstack_router_core = require("@tanstack/router-core");
|
||||
let react = require("react");
|
||||
react = require_runtime.__toESM(react, 1);
|
||||
let react_jsx_runtime = require("react/jsx-runtime");
|
||||
//#region src/RouterProvider.tsx
|
||||
/**
|
||||
* Low-level provider that places the router into React context and optionally
|
||||
* updates router options from props. Most apps should use `RouterProvider`.
|
||||
*/
|
||||
function RouterContextProvider({ router, children, ...rest }) {
|
||||
if ((0, _tanstack_router_core.hasKeys)(rest)) router.update({
|
||||
...router.options,
|
||||
...rest,
|
||||
context: {
|
||||
...router.options.context,
|
||||
...rest.context
|
||||
}
|
||||
});
|
||||
const provider = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_routerContext.routerContext.Provider, {
|
||||
value: router,
|
||||
children
|
||||
});
|
||||
if (router.options.Wrap) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(router.options.Wrap, { children: provider });
|
||||
return provider;
|
||||
}
|
||||
/**
|
||||
* Renders the current match presentation and provides the router to the React
|
||||
* tree via context.
|
||||
*
|
||||
* Accepts mutable router options via props. Configure initialization-only
|
||||
* options with `createRouter`.
|
||||
*
|
||||
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/createRouterFunction
|
||||
*/
|
||||
function RouterProvider({ router, ...rest }) {
|
||||
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RouterContextProvider, {
|
||||
router,
|
||||
...rest,
|
||||
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Matches.Matches, {})
|
||||
});
|
||||
}
|
||||
//#endregion
|
||||
exports.RouterContextProvider = RouterContextProvider;
|
||||
exports.RouterProvider = RouterProvider;
|
||||
|
||||
//# sourceMappingURL=RouterProvider.cjs.map
|
||||
Reference in new issue
Block a user