@tanstack/react-router 1.163.2 → 1.166.2

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.
@@ -5254,7 +5254,13 @@ The not-found error above will be handled by the same route or nearest parent ro
5254
5254
 
5255
5255
  If neither the route nor any suitable parent route is found to handle the error, the root route will handle it using TanStack Router's **extremely basic (and purposefully undesirable)** default not-found component that simply renders \`<p>Not Found</p>\`. It's highly recommended to either attach at least one \`notFoundComponent\` to the root route or configure a router-wide \`defaultNotFoundComponent\` to handle not-found errors.
5256
5256
 
5257
- > ⚠️ Throwing a notFound error in a beforeLoad method will always trigger the \_\_root notFoundComponent. Since beforeLoad methods are run prior to the route loader methods, there is no guarantee that any required data for layouts have successfully loaded before the error is thrown.
5257
+ > ⚠️ When you throw \`notFound()\` in \`beforeLoad\`, TanStack Router resolves it the same way as other not-found errors:
5258
+ >
5259
+ > - If you pass \`routeId\`, that route (or the nearest valid ancestor boundary) handles it.
5260
+ > - If you don't pass \`routeId\`, the nearest route/ancestor with a \`notFoundComponent\` handles it (based on the router's mode and matching rules).
5261
+ > - If no suitable boundary is found, handling falls back to the root/default not-found behavior.
5262
+ >
5263
+ > For \`beforeLoad\`-thrown not-found errors, TanStack Router still runs required parent loaders so the selected not-found boundary can render with the loader data it depends on.
5258
5264
 
5259
5265
  ## Specifying Which Routes Handle Not Found Errors
5260
5266
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/react-router",
3
- "version": "1.163.2",
3
+ "version": "1.166.2",
4
4
  "description": "Modern and scalable routing for React applications",
5
5
  "author": "Tanner Linsley",
6
6
  "license": "MIT",
@@ -82,7 +82,7 @@
82
82
  "tiny-invariant": "^1.3.3",
83
83
  "tiny-warning": "^1.0.3",
84
84
  "@tanstack/history": "1.161.4",
85
- "@tanstack/router-core": "1.163.2"
85
+ "@tanstack/router-core": "1.166.2"
86
86
  },
87
87
  "devDependencies": {
88
88
  "@testing-library/jest-dom": "^6.6.3",