Skip to content

Commit

Permalink
examples: migrate more scroll restoration
Browse files Browse the repository at this point in the history
  • Loading branch information
tannerlinsley committed Jan 30, 2025
1 parent ef79114 commit 6eb9427
Show file tree
Hide file tree
Showing 10 changed files with 2 additions and 17 deletions.
3 changes: 1 addition & 2 deletions e2e/react-router/basic-scroll-restoration/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
Link,
Outlet,
RouterProvider,
ScrollRestoration,
createRootRoute,
createRoute,
createRouter,
Expand Down Expand Up @@ -36,7 +35,6 @@ function RootComponent() {
</Link>
</div>
<Outlet />
<ScrollRestoration getKey={(location) => location.pathname} />
<TanStackRouterDevtools />
</>
)
Expand Down Expand Up @@ -214,6 +212,7 @@ const router = createRouter({
routeTree,
defaultPreload: 'intent',
scrollRestoration: true,
getScrollRestorationKey: (location) => location.pathname,
})

declare global {
Expand Down
1 change: 0 additions & 1 deletion e2e/start/basic-auth/app/routes/__root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ function RootDocument({ children }: { children: React.ReactNode }) {
</div>
<hr />
{children}
<ScrollRestoration />
<TanStackRouterDevtools position="bottom-right" />
<Scripts />
</body>
Expand Down
1 change: 0 additions & 1 deletion e2e/start/basic-react-query/app/routes/__root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ function RootDocument({ children }: { children: React.ReactNode }) {
</div>
<hr />
{children}
<ScrollRestoration />
<TanStackRouterDevtools position="bottom-right" />
<ReactQueryDevtools buttonPosition="bottom-left" />
<Scripts />
Expand Down
1 change: 0 additions & 1 deletion e2e/start/basic-rsc/app/routes/__root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ function RootDocument({ children }: { children: React.ReactNode }) {
<hr />
{/* <React.Suspense fallback={null}>{children}</React.Suspense> */}
{children}
<ScrollRestoration />
<TanStackRouterDevtools position="bottom-right" />
<Scripts />
</body>
Expand Down
1 change: 0 additions & 1 deletion e2e/start/basic-tsr-config/src/app/routes/__root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ function RootDocument({ children }: { children: React.ReactNode }) {
</head>
<body>
{children}
<ScrollRestoration />
<Scripts />
</body>
</html>
Expand Down
8 changes: 1 addition & 7 deletions e2e/start/basic/app/routes/__root.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import * as React from 'react'
import {
Link,
Outlet,
ScrollRestoration,
createRootRoute,
} from '@tanstack/react-router'
import { Link, Outlet, createRootRoute } from '@tanstack/react-router'
import { Meta, Scripts } from '@tanstack/start'

import { DefaultCatchBoundary } from '~/components/DefaultCatchBoundary'
Expand Down Expand Up @@ -157,7 +152,6 @@ function RootDocument({ children }: { children: React.ReactNode }) {
</div>
<hr />
{children}
<ScrollRestoration />
<RouterDevtools position="bottom-right" />
<Scripts />
</body>
Expand Down
1 change: 0 additions & 1 deletion e2e/start/clerk-basic/app/routes/__root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ function RootDocument({ children }: { children: React.ReactNode }) {
</div>
<hr />
{children}
<ScrollRestoration />
<TanStackRouterDevtools position="bottom-right" />
<Scripts />
</body>
Expand Down
1 change: 0 additions & 1 deletion e2e/start/scroll-restoration/app/routes/__root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ function RootDocument({ children }: { children: React.ReactNode }) {
{children}
<hr />
<Nav type="footer" />
<ScrollRestoration />
<Scripts />
</body>
</html>
Expand Down
1 change: 0 additions & 1 deletion e2e/start/website/app/routes/__root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ function RootDocument({ children }: { children: React.ReactNode }) {
</head>
<body>
{children}
<ScrollRestoration />
<TanStackRouterDevtools position="bottom-right" />
<Scripts />
</body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ function RootDocument({ children }: Readonly<{ children: ReactNode }>) {
</head>
<body>
{children}
<ScrollRestoration />
<Scripts />
</body>
</html>
Expand Down

0 comments on commit 6eb9427

Please sign in to comment.