Skip to content
Source
Sign inSign up
TanStack/router

test(router, start): query navigation transitions #5802

Mergedbirkskyum(GitHub profile, opens in a new tab)merged 5 commits intomain fromrefs/pull/5802/headmerged by birkskyum(GitHub profile, opens in a new tab)

Showing 13 changed files with 129 additions and 14 deletions (loading 7).

x
0 of 13 viewed, 13 left
6 additions and 4 deletionse2e/react-router/basic-react-query-file-based/src/routes/transition/count/query.tsxModified
View file
@@ -1,5 +1,5 @@
import { Link, createFileRoute } from '@tanstack/react-router'
-import { Suspense, useMemo } from 'react'
+import { Suspense } from 'react'
import { queryOptions, useQuery } from '@tanstack/react-query'
import { z } from 'zod'
​
@@ -12,7 +12,7 @@
queryKey: ['transition-double', n],
queryFn: async () => {
await new Promise((resolve) => setTimeout(resolve, 1000))
- return n * 2
+ return { n, double: n * 2 }
},
placeholderData: (oldData) => oldData,
})
@@ -44,8 +44,10 @@
</Link>
​
<div className="mt-2">
- <div data-testid="n-value">n: {search.n}</div>
- <div data-testid="double-value">double: {doubleQuery.data}</div>
+ <div data-testid="n-value">n: {doubleQuery.data?.n}</div>
+ <div data-testid="double-value">