Minor Changes
-
#9081
53169f5- Add the typedstructuralSharingoption andValidateSelectedsupport touseRouteContext(includingRoute.useRouteContext,RootRoute.useRouteContext,RouteApi.useRouteContext, andLazyRoute.useRouteContext) in@tanstack/react-router, matchinguseMatch,useSearch,useParams,useLoaderData, anduseLoaderDeps.Also re-export the
ResolveUseRouteContexthelper type from@tanstack/router-core.Note for apps with
defaultStructuralSharing: true: TypeScript now validatesuseRouteContextselectreturn types withValidateSelected, matching the other React hooks. Call sites whoseselectreturns a function or an object with methods (such asQueryClientor an auth client) must passstructuralSharing: falseto opt out (previouslystructuralSharingwas not accepted onuseRouteContext).