@tanstack/react-router 1.129.7 → 1.129.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -792,8 +792,8 @@ interface RouteMatch {
792
792
  routeId: string
793
793
  pathname: string
794
794
  params: Route['allParams']
795
- status: 'pending' | 'success' | 'error'
796
- isFetching: boolean
795
+ status: 'pending' | 'success' | 'error' | 'redirected' | 'notFound'
796
+ isFetching: false | 'beforeLoad' | 'loader'
797
797
  showPending: boolean
798
798
  error: unknown
799
799
  paramsError: unknown
@@ -806,6 +806,7 @@ interface RouteMatch {
806
806
  fetchedAt: number
807
807
  abortController: AbortController
808
808
  cause: 'enter' | 'stay'
809
+ ssr?: boolean | 'data-only'
809
810
  }
810
811
  \`\`\`
811
812
 
@@ -1109,6 +1110,72 @@ If you want to configure to remount a route component upon \`params\` change, us
1109
1110
  remountDeps: ({ params }) => params
1110
1111
  \`\`\`
1111
1112
 
1113
+ ### \`headers\` method
1114
+
1115
+ - Type:
1116
+
1117
+ \`\`\`tsx
1118
+ type headers = (opts: {
1119
+ matches: Array<RouteMatch>
1120
+ match: RouteMatch
1121
+ params: TAllParams
1122
+ loaderData?: TLoaderData
1123
+ }) => Promise<Record<string, string>> | Record<string, string>
1124
+ \`\`\`
1125
+
1126
+ - Optional
1127
+ - Allows you to specify custom HTTP headers to be sent when this route is rendered during SSR. The function receives the current match context and should return a plain object of header name/value pairs.
1128
+
1129
+ ### \`head\` method
1130
+
1131
+ - Type:
1132
+
1133
+ \`\`\`tsx
1134
+ type head = (ctx: {
1135
+ matches: Array<RouteMatch>
1136
+ match: RouteMatch
1137
+ params: TAllParams
1138
+ loaderData?: TLoaderData
1139
+ }) =>
1140
+ | Promise<{
1141
+ links?: RouteMatch['links']
1142
+ scripts?: RouteMatch['headScripts']
1143
+ meta?: RouteMatch['meta']
1144
+ styles?: RouteMatch['styles']
1145
+ }>
1146
+ | {
1147
+ links?: RouteMatch['links']
1148
+ scripts?: RouteMatch['headScripts']
1149
+ meta?: RouteMatch['meta']
1150
+ styles?: RouteMatch['styles']
1151
+ }
1152
+ \`\`\`
1153
+
1154
+ - Optional
1155
+ - Returns additional elements to inject into the document \`<head>\` for this route. Use it to add route-level SEO metadata, preload links, inline styles, or custom scripts.
1156
+
1157
+ ### \`scripts\` method
1158
+
1159
+ - Type:
1160
+
1161
+ \`\`\`tsx
1162
+ type scripts = (ctx: {
1163
+ matches: Array<RouteMatch>
1164
+ match: RouteMatch
1165
+ params: TAllParams
1166
+ loaderData?: TLoaderData
1167
+ }) => Promise<RouteMatch['scripts']> | RouteMatch['scripts']
1168
+ \`\`\`
1169
+
1170
+ - Optional
1171
+ - A shorthand helper to return only \`<script>\` elements. Equivalent to returning the \`scripts\` field from the \`head\` method.
1172
+
1173
+ ### \`codeSplitGroupings\` property
1174
+
1175
+ - Type: \`Array<Array<'loader' | 'component' | 'pendingComponent' | 'notFoundComponent' | 'errorComponent'>>\`
1176
+ - Optional
1177
+ - Fine-grained control over how the router groups lazy-loaded pieces of a route into chunks. Each inner array represents a group of assets that will be placed into the same bundle during code-splitting.
1178
+
1112
1179
  # Route type
1113
1180
 
1114
1181
  The \`Route\` type is used to describe a route instance.