Skip to content

Commit 4289738

Browse files
ci: apply automated fixes
1 parent a54628b commit 4289738

7 files changed

Lines changed: 25 additions & 22 deletions

File tree

examples/react/react-start/src/router.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ export function getRouter() {
1414
defaultPreload: 'intent',
1515
defaultErrorComponent: DefaultCatchBoundary,
1616
defaultNotFoundComponent: () => <NotFound />,
17-
Wrap: ({ children }) => <QueryClientProvider client={queryClient}>{children}</QueryClientProvider>,
17+
Wrap: ({ children }) => (
18+
<QueryClientProvider client={queryClient}>{children}</QueryClientProvider>
19+
),
1820
})
1921
setupRouterSsrQueryIntegration({
2022
router,

examples/react/react-start/src/routes/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function ProjectsComponent() {
1414
return (
1515
<div>
1616
<h1>TanStack Repositories {isFetching ? <Spinner /> : null}</h1>
17-
<Link to='/'>Back</Link>
17+
<Link to="/">Back</Link>
1818
{data.map((project) => (
1919
<p key={project.full_name}>
2020
<Link

examples/react/react-start/src/routes/projects.$projectId.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function RouteComponent() {
1515
return (
1616
<div>
1717
<h1>TanStack Repositories</h1>
18-
<Link to='/'>Back</Link>
18+
<Link to="/">Back</Link>
1919
<h1>
2020
{projectId} {isFetching ? <Spinner /> : null}
2121
</h1>

examples/react/react-start/src/utils/queries.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { queryOptions } from "@tanstack/react-query";
1+
import { queryOptions } from '@tanstack/react-query'
22

33
export async function fetchProjects(): Promise<
44
Array<{ name: string; full_name: string }>
@@ -12,10 +12,11 @@ export async function fetchProjects(): Promise<
1212
return await response.json()
1313
}
1414

15-
export const projectsQuery = () => queryOptions({
16-
queryKey: ['projects'],
17-
queryFn: fetchProjects,
18-
})
15+
export const projectsQuery = () =>
16+
queryOptions({
17+
queryKey: ['projects'],
18+
queryFn: fetchProjects,
19+
})
1920

2021
export async function fetchProject(id: string): Promise<{
2122
full_name: string
@@ -30,7 +31,8 @@ export async function fetchProject(id: string): Promise<{
3031
return await response.json()
3132
}
3233

33-
export const projectQuery = (id: string) => queryOptions({
34-
queryKey: ['project', id],
35-
queryFn: () => fetchProject(id),
36-
})
34+
export const projectQuery = (id: string) =>
35+
queryOptions({
36+
queryKey: ['project', id],
37+
queryFn: () => fetchProject(id),
38+
})

examples/react/react-start/vite.config.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,5 @@ export default defineConfig({
66
server: {
77
port: 3000,
88
},
9-
plugins: [
10-
tanstackStart(),
11-
viteReact(),
12-
],
9+
plugins: [tanstackStart(), viteReact()],
1310
})

packages/react-query/src/suspense.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ import type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'
1212
/**
1313
* TODO (v6): Bump peer dependency to React 19 and use `React.use` directly.
1414
*/
15-
export function suspend<T extends Promise<unknown>>(promise: T, debugId?: string): void {
15+
export function suspend<T extends Promise<unknown>>(
16+
promise: T,
17+
debugId?: string,
18+
): void {
1619
if (typeof React.use === 'function') {
1720
console.debug(`Suspending ${debugId} using React.use`)
1821
// `React.use` can be called conditionally

packages/react-query/src/useBaseQuery.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use client'
22
import * as React from 'react'
33

4-
import { noop, notifyManager } from '@tanstack/query-core'
4+
import { noop, notifyManager } from '@tanstack/query-core'
55
import { useQueryClient } from './QueryClientProvider'
66
import { useQueryErrorResetBoundary } from './QueryErrorResetBoundary'
77
import {
@@ -15,7 +15,6 @@ import {
1515
fetchOptimistic,
1616
shouldSuspend,
1717
suspend,
18-
1918
} from './suspense'
2019
import type {
2120
QueryClient,
@@ -131,9 +130,9 @@ export function useBaseQuery<
131130
fetchOptimistic(defaultedOptions, observer, errorResetBoundary)
132131
: // subscribe to the "cache promise" so that we can finalize the currentThenable once data comes in
133132
query?.promise
134-
if (promise) {
135-
suspend(promise, defaultedOptions.queryHash)
136-
}
133+
if (promise) {
134+
suspend(promise, defaultedOptions.queryHash)
135+
}
137136
}
138137
console.debug(`${defaultedOptions.queryHash} after suspend. Result:`, result)
139138

0 commit comments

Comments
 (0)