@tanstack/react-router 1.120.12 → 1.120.15

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.
@@ -388,7 +388,7 @@ If you are using code-based routing, you can still code-split your routes using
388
388
  Create a lazy route using the \`createLazyRoute\` function.
389
389
 
390
390
  \`\`\`tsx
391
- // src/posts.tsx
391
+ // src/posts.lazy.tsx
392
392
  export const Route = createLazyRoute('/posts')({
393
393
  component: MyComponent,
394
394
  })
@@ -4318,6 +4318,19 @@ const router = createRouter({
4318
4318
  })
4319
4319
  \`\`\`
4320
4320
 
4321
+ For complex selectors that cannot be simply resolved using \`document.querySelector(selector)\`, you can pass functions that return HTML elements to \`routerOptions.scrollToTopSelectors\`:
4322
+
4323
+ \`\`\`tsx
4324
+ const selector = () =>
4325
+ document
4326
+ .querySelector('#shadowRootParent')
4327
+ ?.shadowRoot?.querySelector('#main-scrollable-area')
4328
+
4329
+ const router = createRouter({
4330
+ scrollToTopSelectors: [selector],
4331
+ })
4332
+ \`\`\`
4333
+
4321
4334
  These selectors are handled **in addition to \`window\`** which cannot be disabled currently.
4322
4335
 
4323
4336
  ## Scroll Restoration
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/react-router",
3
- "version": "1.120.12",
3
+ "version": "1.120.15",
4
4
  "description": "Modern and scalable routing for React applications",
5
5
  "author": "Tanner Linsley",
6
6
  "license": "MIT",
@@ -59,8 +59,8 @@
59
59
  "jsesc": "^3.1.0",
60
60
  "tiny-invariant": "^1.3.3",
61
61
  "tiny-warning": "^1.0.3",
62
- "@tanstack/history": "1.115.0",
63
- "@tanstack/router-core": "1.120.10"
62
+ "@tanstack/router-core": "1.120.15",
63
+ "@tanstack/history": "1.115.0"
64
64
  },
65
65
  "devDependencies": {
66
66
  "@testing-library/jest-dom": "^6.6.3",