@tanstack/react-router 1.128.6 → 1.128.8

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.
@@ -4336,22 +4336,22 @@ function AdvancedLanguageSwitcher() {
4336
4336
  }
4337
4337
  \`\`\`
4338
4338
 
4339
- ### Advanced i18n with Route Groups
4339
+ ### Advanced i18n with Optional Parameters
4340
4340
 
4341
- Organize i18n routes using route groups for better structure:
4341
+ Organize i18n routes using optional parameters for flexible locale handling:
4342
4342
 
4343
4343
  \`\`\`tsx
4344
4344
  // Route structure:
4345
4345
  // routes/
4346
- // ({-$locale})/
4346
+ // {-$locale}/
4347
4347
  // index.tsx // /, /en, /fr
4348
4348
  // about.tsx // /about, /en/about, /fr/about
4349
4349
  // blog/
4350
4350
  // index.tsx // /blog, /en/blog, /fr/blog
4351
4351
  // $slug.tsx // /blog/post, /en/blog/post, /fr/blog/post
4352
4352
 
4353
- // routes/({-$locale})/index.tsx
4354
- export const Route = createFileRoute('/({-$locale})/')({
4353
+ // routes/{-$locale}/index.tsx
4354
+ export const Route = createFileRoute('/{-$locale}/')({
4355
4355
  component: HomeComponent,
4356
4356
  })
4357
4357
 
@@ -4367,8 +4367,8 @@ function HomeComponent() {
4367
4367
  )
4368
4368
  }
4369
4369
 
4370
- // routes/({-$locale})/about.tsx
4371
- export const Route = createFileRoute('/({-$locale})/about')({
4370
+ // routes/{-$locale}/about.tsx
4371
+ export const Route = createFileRoute('/{-$locale}/about')({
4372
4372
  component: AboutComponent,
4373
4373
  })
4374
4374
  \`\`\`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/react-router",
3
- "version": "1.128.6",
3
+ "version": "1.128.8",
4
4
  "description": "Modern and scalable routing for React applications",
5
5
  "author": "Tanner Linsley",
6
6
  "license": "MIT",
@@ -80,7 +80,7 @@
80
80
  "tiny-invariant": "^1.3.3",
81
81
  "tiny-warning": "^1.0.3",
82
82
  "@tanstack/history": "1.121.34",
83
- "@tanstack/router-core": "1.128.6"
83
+ "@tanstack/router-core": "1.128.8"
84
84
  },
85
85
  "devDependencies": {
86
86
  "@testing-library/jest-dom": "^6.6.3",
package/src/not-found.tsx CHANGED
@@ -25,7 +25,7 @@ export function CatchNotFound(props: {
25
25
  throw error
26
26
  }
27
27
  }}
28
- errorComponent={({ error }: { error: Error }) => {
28
+ errorComponent={({ error }) => {
29
29
  if (isNotFound(error)) {
30
30
  return props.fallback?.(error)
31
31
  } else {