@tanstack/react-router
Advanced tools
Comparing version 0.0.1-beta.79 to 0.0.1-beta.80
@@ -411,6 +411,6 @@ /** | ||
} | ||
function useBlocker(message, when = true) { | ||
function useBlocker(message, condition = true) { | ||
const router = useRouter(); | ||
React__namespace.useEffect(() => { | ||
if (!when) return; | ||
if (!condition) return; | ||
let unblock = router.history.block((retry, cancel) => { | ||
@@ -429,6 +429,6 @@ if (window.confirm(message)) { | ||
message, | ||
when, | ||
condition, | ||
children | ||
}) { | ||
useBlocker(message, when); | ||
useBlocker(message, condition); | ||
return children ?? null; | ||
@@ -435,0 +435,0 @@ } |
@@ -403,6 +403,6 @@ /** | ||
} | ||
function useBlocker(message, when = true) { | ||
function useBlocker(message, condition = true) { | ||
const router = useRouter(); | ||
React.useEffect(() => { | ||
if (!when) return; | ||
if (!condition) return; | ||
let unblock = router.history.block((retry, cancel) => { | ||
@@ -421,6 +421,6 @@ if (window.confirm(message)) { | ||
message, | ||
when, | ||
condition, | ||
children | ||
}) { | ||
useBlocker(message, when); | ||
useBlocker(message, condition); | ||
return children ?? null; | ||
@@ -427,0 +427,0 @@ } |
@@ -10,3 +10,3 @@ { | ||
{ | ||
"uid": "9710-109", | ||
"uid": "5504-109", | ||
"name": "\u0000rollupPluginBabelHelpers.js" | ||
@@ -19,7 +19,7 @@ }, | ||
"name": "tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js", | ||
"uid": "9710-111" | ||
"uid": "5504-111" | ||
}, | ||
{ | ||
"name": "tiny-warning@1.0.3/node_modules/tiny-warning/dist/tiny-warning.esm.js", | ||
"uid": "9710-113" | ||
"uid": "5504-113" | ||
} | ||
@@ -33,15 +33,15 @@ ] | ||
"name": "store/build/esm/index.js", | ||
"uid": "9710-115" | ||
"uid": "5504-115" | ||
}, | ||
{ | ||
"name": "router/build/esm/index.js", | ||
"uid": "9710-117" | ||
"uid": "5504-117" | ||
}, | ||
{ | ||
"name": "react-store/build/esm/index.js", | ||
"uid": "9710-119" | ||
"uid": "5504-119" | ||
}, | ||
{ | ||
"name": "react-router/src/index.tsx", | ||
"uid": "9710-121" | ||
"uid": "5504-121" | ||
} | ||
@@ -56,50 +56,50 @@ ] | ||
"nodeParts": { | ||
"9710-109": { | ||
"5504-109": { | ||
"renderedLength": 429, | ||
"gzipLength": 238, | ||
"brotliLength": 0, | ||
"mainUid": "9710-108" | ||
"mainUid": "5504-108" | ||
}, | ||
"9710-111": { | ||
"5504-111": { | ||
"renderedLength": 181, | ||
"gzipLength": 129, | ||
"brotliLength": 0, | ||
"mainUid": "9710-110" | ||
"mainUid": "5504-110" | ||
}, | ||
"9710-113": { | ||
"5504-113": { | ||
"renderedLength": 44, | ||
"gzipLength": 62, | ||
"brotliLength": 0, | ||
"mainUid": "9710-112" | ||
"mainUid": "5504-112" | ||
}, | ||
"9710-115": { | ||
"5504-115": { | ||
"renderedLength": 1288, | ||
"gzipLength": 497, | ||
"brotliLength": 0, | ||
"mainUid": "9710-114" | ||
"mainUid": "5504-114" | ||
}, | ||
"9710-117": { | ||
"5504-117": { | ||
"renderedLength": 49433, | ||
"gzipLength": 11720, | ||
"brotliLength": 0, | ||
"mainUid": "9710-116" | ||
"mainUid": "5504-116" | ||
}, | ||
"9710-119": { | ||
"5504-119": { | ||
"renderedLength": 1571, | ||
"gzipLength": 594, | ||
"brotliLength": 0, | ||
"mainUid": "9710-118" | ||
"mainUid": "5504-118" | ||
}, | ||
"9710-121": { | ||
"renderedLength": 12277, | ||
"gzipLength": 3110, | ||
"5504-121": { | ||
"renderedLength": 12297, | ||
"gzipLength": 3115, | ||
"brotliLength": 0, | ||
"mainUid": "9710-120" | ||
"mainUid": "5504-120" | ||
} | ||
}, | ||
"nodeMetas": { | ||
"9710-108": { | ||
"5504-108": { | ||
"id": "\u0000rollupPluginBabelHelpers.js", | ||
"moduleParts": { | ||
"index.production.js": "9710-109" | ||
"index.production.js": "5504-109" | ||
}, | ||
@@ -109,10 +109,10 @@ "imported": [], | ||
{ | ||
"uid": "9710-120" | ||
"uid": "5504-120" | ||
} | ||
] | ||
}, | ||
"9710-110": { | ||
"5504-110": { | ||
"id": "/node_modules/.pnpm/tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js", | ||
"moduleParts": { | ||
"index.production.js": "9710-111" | ||
"index.production.js": "5504-111" | ||
}, | ||
@@ -122,10 +122,10 @@ "imported": [], | ||
{ | ||
"uid": "9710-116" | ||
"uid": "5504-116" | ||
} | ||
] | ||
}, | ||
"9710-112": { | ||
"5504-112": { | ||
"id": "/node_modules/.pnpm/tiny-warning@1.0.3/node_modules/tiny-warning/dist/tiny-warning.esm.js", | ||
"moduleParts": { | ||
"index.production.js": "9710-113" | ||
"index.production.js": "5504-113" | ||
}, | ||
@@ -135,10 +135,10 @@ "imported": [], | ||
{ | ||
"uid": "9710-116" | ||
"uid": "5504-116" | ||
} | ||
] | ||
}, | ||
"9710-114": { | ||
"5504-114": { | ||
"id": "/packages/store/build/esm/index.js", | ||
"moduleParts": { | ||
"index.production.js": "9710-115" | ||
"index.production.js": "5504-115" | ||
}, | ||
@@ -148,20 +148,20 @@ "imported": [], | ||
{ | ||
"uid": "9710-116" | ||
"uid": "5504-116" | ||
} | ||
] | ||
}, | ||
"9710-116": { | ||
"5504-116": { | ||
"id": "/packages/router/build/esm/index.js", | ||
"moduleParts": { | ||
"index.production.js": "9710-117" | ||
"index.production.js": "5504-117" | ||
}, | ||
"imported": [ | ||
{ | ||
"uid": "9710-110" | ||
"uid": "5504-110" | ||
}, | ||
{ | ||
"uid": "9710-112" | ||
"uid": "5504-112" | ||
}, | ||
{ | ||
"uid": "9710-114" | ||
"uid": "5504-114" | ||
} | ||
@@ -171,14 +171,14 @@ ], | ||
{ | ||
"uid": "9710-120" | ||
"uid": "5504-120" | ||
} | ||
] | ||
}, | ||
"9710-118": { | ||
"5504-118": { | ||
"id": "/packages/react-store/build/esm/index.js", | ||
"moduleParts": { | ||
"index.production.js": "9710-119" | ||
"index.production.js": "5504-119" | ||
}, | ||
"imported": [ | ||
{ | ||
"uid": "9710-123" | ||
"uid": "5504-123" | ||
} | ||
@@ -188,23 +188,23 @@ ], | ||
{ | ||
"uid": "9710-120" | ||
"uid": "5504-120" | ||
} | ||
] | ||
}, | ||
"9710-120": { | ||
"5504-120": { | ||
"id": "/packages/react-router/src/index.tsx", | ||
"moduleParts": { | ||
"index.production.js": "9710-121" | ||
"index.production.js": "5504-121" | ||
}, | ||
"imported": [ | ||
{ | ||
"uid": "9710-108" | ||
"uid": "5504-108" | ||
}, | ||
{ | ||
"uid": "9710-122" | ||
"uid": "5504-122" | ||
}, | ||
{ | ||
"uid": "9710-116" | ||
"uid": "5504-116" | ||
}, | ||
{ | ||
"uid": "9710-118" | ||
"uid": "5504-118" | ||
} | ||
@@ -215,3 +215,3 @@ ], | ||
}, | ||
"9710-122": { | ||
"5504-122": { | ||
"id": "react", | ||
@@ -222,3 +222,3 @@ "moduleParts": {}, | ||
{ | ||
"uid": "9710-120" | ||
"uid": "5504-120" | ||
} | ||
@@ -228,3 +228,3 @@ ], | ||
}, | ||
"9710-123": { | ||
"5504-123": { | ||
"id": "use-sync-external-store/shim/with-selector", | ||
@@ -235,3 +235,3 @@ "moduleParts": {}, | ||
{ | ||
"uid": "9710-118" | ||
"uid": "5504-118" | ||
} | ||
@@ -238,0 +238,0 @@ ], |
@@ -56,3 +56,3 @@ /** | ||
message: string; | ||
when?: boolean | any; | ||
condition?: boolean | any; | ||
children?: ReactNode; | ||
@@ -110,5 +110,5 @@ }; | ||
}): JSX.Element; | ||
declare function useBlocker(message: string, when?: boolean | any): void; | ||
declare function Block({ message, when, children }: PromptProps): any; | ||
declare function useBlocker(message: string, condition?: boolean | any): void; | ||
declare function Block({ message, condition, children }: PromptProps): any; | ||
export { Block, ErrorComponent, Link, LinkFn, LinkPropsOptions, MakeLinkOptions, MakeLinkPropsOptions, MakeMatchRouteOptions, MakeUseMatchRouteOptions, MatchRoute, MatchesProviderProps, Navigate, Outlet, PromptProps, ReactRouter, RouteComponent, RouterProps, RouterProvider, SyncRouteComponent, lazy, matchesContext, routerContext, useBlocker, useLinkProps, useMatch, useMatchRoute, useMatches, useNavigate, useParams, useRoute, useRouter, useRouterContext, useSearch }; |
@@ -41,3 +41,3 @@ /** | ||
* @license MIT | ||
*/function Y(t,e=(t=>t),a){return r.useSyncExternalStoreWithSelector(t.subscribe,(()=>t.state),(()=>t.state),e,a?Z:void 0)}function Z(t,e){if(Object.is(t,e))return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return!1;const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!1;for(let a=0;a<r.length;a++)if(!Object.prototype.hasOwnProperty.call(e,r[a])||!Object.is(t[r[a]],e[r[a]]))return!1;return!0}function tt(t){const e=ot(),{type:r,children:a,target:s,activeProps:n=(()=>({className:"active"})),inactiveProps:i=(()=>({})),activeOptions:c,disabled:h,hash:u,search:l,params:p,to:d=".",preload:f,preloadDelay:m,replace:y,style:g,className:v,onClick:w,onFocus:S,onMouseEnter:_,onMouseLeave:L,onTouchStart:E,...P}=t,x=e.buildLink(t);if("external"===x.type){const{href:t}=x;return{href:t}}const{handleClick:R,handleFocus:C,handleEnter:M,handleLeave:k,handleTouchStart:O,isActive:j,next:I}=x,$=t=>e=>{e.persist&&e.persist(),t.filter(Boolean).forEach((t=>{e.defaultPrevented||t(e)}))},A=j?b(n,{})??{}:{},T=j?{}:b(i,{})??{};return{...A,...T,...P,href:h?void 0:I.href,onClick:$([w,t=>{o.startTransition?o.startTransition((()=>{R(t)})):R(t)}]),onFocus:$([S,C]),onMouseEnter:$([_,M]),onMouseLeave:$([L,k]),onTouchStart:$([E,O]),target:s,style:{...g,...A.style,...T.style},className:[v,A.className,T.className].filter(Boolean).join(" ")||void 0,...h?{role:"link","aria-disabled":!0}:void 0,"data-status":j?"active":void 0}}const et=o.forwardRef(((t,e)=>{const r=tt(t);return o.createElement("a",s({ref:e},r,{children:"function"==typeof t.children?t.children({isActive:"active"===r["data-status"]}):t.children}))}));const rt=o.createContext(null),at=o.createContext(null);function ot(){const t=o.useContext(at);return Y(t.router.__store),t.router}function st(t,e){const r=ot();return Y(r.__store,t,e),r}function nt(){return o.useContext(rt)}function it(t){const e=ot(),r=nt()[0],a=t?.from?e.state.currentMatches.find((e=>e.route.id===t?.from)):r;return n(a,t?.from&&t.from),(t?.strict??1)&&n(r.route.id==a?.route.id,(a?.route.id,r.route.id,a?.route.id,a?.route.id)),Y(a.__store,(e=>t?.track?.(a)??a),t?.shallow),a}function ct(){const t=ot();return o.useCallback((e=>{const{pending:r,caseSensitive:a,...o}=e;return t.matchRoute(o,{pending:r,caseSensitive:a})}),[])}function ht(){const t=nt().slice(1),e=t[0];return e?o.createElement(ut,{matches:t,match:e}):null}function ut({matches:t,match:e}){const r=ot();Y(e.__store,(t=>[t.status,t.error]),!0);const a=o.useCallback((()=>null),[]),s=o.useCallback((t=>{if("error"===t.match.state.status)throw t.match.state.error;if("success"===t.match.state.status)return o.createElement(t.match.component??r.options.defaultComponent??ht);if("pending"===t.match.state.status)throw t.match.__loadPromise;n(!1)}),[]),i=e.pendingComponent??r.options.defaultPendingComponent??a,c=e.errorComponent??r.options.defaultErrorComponent,h=e.route.options.wrapInSuspense??1?o.Suspense:lt,u=c?pt:lt;return o.createElement(rt.Provider,{value:t},o.createElement(h,{fallback:o.createElement(i,null)},o.createElement(u,{key:e.route.id,errorComponent:c,onCatch:()=>{e.id}},o.createElement(s,{match:e}))))}function lt(t){return o.createElement(o.Fragment,null,t.children)}class pt extends o.Component{state={error:!1,info:void 0};componentDidCatch(t,e){this.props.onCatch(t,e),console.error(t),this.setState({error:t,info:e})}render(){return o.createElement(dt,s({},this.props,{errorState:this.state,reset:()=>this.setState({})}))}}function dt(t){const[e,r]=o.useState(t.errorState),a=ot(),s=t.errorComponent??ft,n=o.useRef("");return o.useEffect((()=>{e&&a.state.currentLocation.key!==n.current&&r({}),n.current=a.state.currentLocation.key}),[e,a.state.currentLocation.key]),o.useEffect((()=>{t.errorState.error&&r(t.errorState)}),[t.errorState.error]),t.errorState.error&&e.error?o.createElement(s,e):t.children}function ft({error:t}){return o.createElement("div",{style:{padding:".5rem",maxWidth:"100%"}},o.createElement("strong",{style:{fontSize:"1.2rem"}},"Something went wrong!"),o.createElement("div",{style:{height:".5rem"}}),o.createElement("div",null,o.createElement("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".5rem",color:"red",overflow:"auto"}},t.message?o.createElement("code",null,t.message):null)))}function mt(t,e=!0){const r=st();o.useEffect((()=>{if(!e)return;let a=r.history.block(((e,r)=>{window.confirm(t)?(a(),e()):r()}));return a}))}t.Block=function({message:t,when:e,children:r}){return mt(t,e),r??null},t.ErrorComponent=ft,t.Link=et,t.MatchRoute=function(t){const e=ct()(t);return e?"function"==typeof t.children?t.children(e):e?t.children:null:null},t.Navigate=function(t){const e=ot();return o.useLayoutEffect((()=>{e.navigate(t)}),[]),null},t.Outlet=ht,t.ReactRouter=class extends K{constructor(t){super({...t,loadComponent:async t=>(t.preload&&await t.preload(),t)})}},t.RootRoute=B,t.Route=H,t.RouteMatch=X,t.Router=K,t.RouterProvider=function({router:t,...e}){t.update(e);const r=Y(t.__store,(t=>t.currentMatches));return o.useEffect(t.mount,[t]),o.createElement(at.Provider,{value:{router:t}},o.createElement(rt.Provider,{value:[void 0,...r]},o.createElement(pt,{errorComponent:ft,onCatch:()=>{}},o.createElement(ht,null))))},t.cleanPath=x,t.createBrowserHistory=f,t.createHashHistory=function(){return f({getHref:()=>window.location.hash.substring(1),createHref:t=>`#${t}`})},t.createMemoryHistory=m,t.decode=D,t.defaultFetchServerDataFn=W,t.defaultParseSearch=F,t.defaultStringifySearch=U,t.encode=A,t.functionalUpdate=b,t.interpolatePath=j,t.invariant=n,t.isPlainObject=_,t.isRedirect=G,t.joinPaths=P,t.last=v,t.lazy=function(t){const e=o.lazy(t);return e.preload=async()=>{await t()},e},t.matchByPath=$,t.matchPathname=I,t.matchesContext=rt,t.parsePathname=O,t.parseSearchWith=z,t.partialDeepEqual=E,t.pick=w,t.redirect=function(t){return t.isRedirect=!0,t},t.replaceEqualDeep=S,t.resolvePath=k,t.rootRouteId=N,t.routerContext=at,t.stringifySearchWith=q,t.trimPath=M,t.trimPathLeft=R,t.trimPathRight=C,t.useBlocker=mt,t.useLinkProps=tt,t.useMatch=it,t.useMatchRoute=ct,t.useMatches=nt,t.useNavigate=function(t){const e=ot();return o.useCallback((r=>e.navigate({...t,...r})),[])},t.useParams=function(t){const e=ot();return Y(e.__store,(e=>{const r=v(e.currentMatches)?.params;return t?.track?.(r)??r}),!0),v(e.state.currentMatches)?.params},t.useRoute=function(t){const e=ot().getRoute(t);return n(e),e},t.useRouter=st,t.useRouterContext=ot,t.useSearch=function(t){const{track:e,...r}=t,a=it(r);return Y(a.__store,(e=>t?.track?.(e.search)??e.search),!0),a.state.search},t.useStore=Y,t.warning=i,Object.defineProperty(t,"__esModule",{value:!0})})); | ||
*/function Y(t,e=(t=>t),a){return r.useSyncExternalStoreWithSelector(t.subscribe,(()=>t.state),(()=>t.state),e,a?Z:void 0)}function Z(t,e){if(Object.is(t,e))return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return!1;const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!1;for(let a=0;a<r.length;a++)if(!Object.prototype.hasOwnProperty.call(e,r[a])||!Object.is(t[r[a]],e[r[a]]))return!1;return!0}function tt(t){const e=ot(),{type:r,children:a,target:s,activeProps:n=(()=>({className:"active"})),inactiveProps:i=(()=>({})),activeOptions:c,disabled:h,hash:u,search:l,params:p,to:d=".",preload:f,preloadDelay:m,replace:y,style:g,className:v,onClick:w,onFocus:S,onMouseEnter:_,onMouseLeave:L,onTouchStart:E,...P}=t,x=e.buildLink(t);if("external"===x.type){const{href:t}=x;return{href:t}}const{handleClick:R,handleFocus:C,handleEnter:M,handleLeave:k,handleTouchStart:O,isActive:j,next:I}=x,$=t=>e=>{e.persist&&e.persist(),t.filter(Boolean).forEach((t=>{e.defaultPrevented||t(e)}))},A=j?b(n,{})??{}:{},T=j?{}:b(i,{})??{};return{...A,...T,...P,href:h?void 0:I.href,onClick:$([w,t=>{o.startTransition?o.startTransition((()=>{R(t)})):R(t)}]),onFocus:$([S,C]),onMouseEnter:$([_,M]),onMouseLeave:$([L,k]),onTouchStart:$([E,O]),target:s,style:{...g,...A.style,...T.style},className:[v,A.className,T.className].filter(Boolean).join(" ")||void 0,...h?{role:"link","aria-disabled":!0}:void 0,"data-status":j?"active":void 0}}const et=o.forwardRef(((t,e)=>{const r=tt(t);return o.createElement("a",s({ref:e},r,{children:"function"==typeof t.children?t.children({isActive:"active"===r["data-status"]}):t.children}))}));const rt=o.createContext(null),at=o.createContext(null);function ot(){const t=o.useContext(at);return Y(t.router.__store),t.router}function st(t,e){const r=ot();return Y(r.__store,t,e),r}function nt(){return o.useContext(rt)}function it(t){const e=ot(),r=nt()[0],a=t?.from?e.state.currentMatches.find((e=>e.route.id===t?.from)):r;return n(a,t?.from&&t.from),(t?.strict??1)&&n(r.route.id==a?.route.id,(a?.route.id,r.route.id,a?.route.id,a?.route.id)),Y(a.__store,(e=>t?.track?.(a)??a),t?.shallow),a}function ct(){const t=ot();return o.useCallback((e=>{const{pending:r,caseSensitive:a,...o}=e;return t.matchRoute(o,{pending:r,caseSensitive:a})}),[])}function ht(){const t=nt().slice(1),e=t[0];return e?o.createElement(ut,{matches:t,match:e}):null}function ut({matches:t,match:e}){const r=ot();Y(e.__store,(t=>[t.status,t.error]),!0);const a=o.useCallback((()=>null),[]),s=o.useCallback((t=>{if("error"===t.match.state.status)throw t.match.state.error;if("success"===t.match.state.status)return o.createElement(t.match.component??r.options.defaultComponent??ht);if("pending"===t.match.state.status)throw t.match.__loadPromise;n(!1)}),[]),i=e.pendingComponent??r.options.defaultPendingComponent??a,c=e.errorComponent??r.options.defaultErrorComponent,h=e.route.options.wrapInSuspense??1?o.Suspense:lt,u=c?pt:lt;return o.createElement(rt.Provider,{value:t},o.createElement(h,{fallback:o.createElement(i,null)},o.createElement(u,{key:e.route.id,errorComponent:c,onCatch:()=>{e.id}},o.createElement(s,{match:e}))))}function lt(t){return o.createElement(o.Fragment,null,t.children)}class pt extends o.Component{state={error:!1,info:void 0};componentDidCatch(t,e){this.props.onCatch(t,e),console.error(t),this.setState({error:t,info:e})}render(){return o.createElement(dt,s({},this.props,{errorState:this.state,reset:()=>this.setState({})}))}}function dt(t){const[e,r]=o.useState(t.errorState),a=ot(),s=t.errorComponent??ft,n=o.useRef("");return o.useEffect((()=>{e&&a.state.currentLocation.key!==n.current&&r({}),n.current=a.state.currentLocation.key}),[e,a.state.currentLocation.key]),o.useEffect((()=>{t.errorState.error&&r(t.errorState)}),[t.errorState.error]),t.errorState.error&&e.error?o.createElement(s,e):t.children}function ft({error:t}){return o.createElement("div",{style:{padding:".5rem",maxWidth:"100%"}},o.createElement("strong",{style:{fontSize:"1.2rem"}},"Something went wrong!"),o.createElement("div",{style:{height:".5rem"}}),o.createElement("div",null,o.createElement("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".5rem",color:"red",overflow:"auto"}},t.message?o.createElement("code",null,t.message):null)))}function mt(t,e=!0){const r=st();o.useEffect((()=>{if(!e)return;let a=r.history.block(((e,r)=>{window.confirm(t)?(a(),e()):r()}));return a}))}t.Block=function({message:t,condition:e,children:r}){return mt(t,e),r??null},t.ErrorComponent=ft,t.Link=et,t.MatchRoute=function(t){const e=ct()(t);return e?"function"==typeof t.children?t.children(e):e?t.children:null:null},t.Navigate=function(t){const e=ot();return o.useLayoutEffect((()=>{e.navigate(t)}),[]),null},t.Outlet=ht,t.ReactRouter=class extends K{constructor(t){super({...t,loadComponent:async t=>(t.preload&&await t.preload(),t)})}},t.RootRoute=B,t.Route=H,t.RouteMatch=X,t.Router=K,t.RouterProvider=function({router:t,...e}){t.update(e);const r=Y(t.__store,(t=>t.currentMatches));return o.useEffect(t.mount,[t]),o.createElement(at.Provider,{value:{router:t}},o.createElement(rt.Provider,{value:[void 0,...r]},o.createElement(pt,{errorComponent:ft,onCatch:()=>{}},o.createElement(ht,null))))},t.cleanPath=x,t.createBrowserHistory=f,t.createHashHistory=function(){return f({getHref:()=>window.location.hash.substring(1),createHref:t=>`#${t}`})},t.createMemoryHistory=m,t.decode=D,t.defaultFetchServerDataFn=W,t.defaultParseSearch=F,t.defaultStringifySearch=U,t.encode=A,t.functionalUpdate=b,t.interpolatePath=j,t.invariant=n,t.isPlainObject=_,t.isRedirect=G,t.joinPaths=P,t.last=v,t.lazy=function(t){const e=o.lazy(t);return e.preload=async()=>{await t()},e},t.matchByPath=$,t.matchPathname=I,t.matchesContext=rt,t.parsePathname=O,t.parseSearchWith=z,t.partialDeepEqual=E,t.pick=w,t.redirect=function(t){return t.isRedirect=!0,t},t.replaceEqualDeep=S,t.resolvePath=k,t.rootRouteId=N,t.routerContext=at,t.stringifySearchWith=q,t.trimPath=M,t.trimPathLeft=R,t.trimPathRight=C,t.useBlocker=mt,t.useLinkProps=tt,t.useMatch=it,t.useMatchRoute=ct,t.useMatches=nt,t.useNavigate=function(t){const e=ot();return o.useCallback((r=>e.navigate({...t,...r})),[])},t.useParams=function(t){const e=ot();return Y(e.__store,(e=>{const r=v(e.currentMatches)?.params;return t?.track?.(r)??r}),!0),v(e.state.currentMatches)?.params},t.useRoute=function(t){const e=ot().getRoute(t);return n(e),e},t.useRouter=st,t.useRouterContext=ot,t.useSearch=function(t){const{track:e,...r}=t,a=it(r);return Y(a.__store,(e=>t?.track?.(e.search)??e.search),!0),a.state.search},t.useStore=Y,t.warning=i,Object.defineProperty(t,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=index.production.js.map |
{ | ||
"name": "@tanstack/react-router", | ||
"author": "Tanner Linsley", | ||
"version": "0.0.1-beta.79", | ||
"version": "0.0.1-beta.80", | ||
"license": "MIT", | ||
@@ -44,4 +44,4 @@ "repository": "tanstack/router", | ||
"@babel/runtime": "^7.16.7", | ||
"@tanstack/router": "0.0.1-beta.79", | ||
"@tanstack/react-store": "0.0.1-beta.62" | ||
"@tanstack/react-store": "0.0.1-beta.62", | ||
"@tanstack/router": "0.0.1-beta.79" | ||
}, | ||
@@ -48,0 +48,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
628875
4233