Skip to content

Commit 54efe22

Browse files
wo-o29manudeli
andauthored
docs: fix type definitions in useQuery options (union, parameters, extra parentheses) (#9596)
Co-authored-by: Jonghyeon Ko <[email protected]>
1 parent ad0ca9f commit 54efe22

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/framework/react/reference/useQuery.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ const {
9191
- This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds.
9292
- A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential backoff.
9393
- A function like `attempt => attempt * 1000` applies linear backoff.
94-
- `staleTime: number | 'static' ((query: Query) => number | 'static')`
94+
- `staleTime: number | 'static' | ((query: Query) => number | 'static')`
9595
- Optional
9696
- Defaults to `0`
9797
- The time in milliseconds after which data is considered stale. This value only applies to the hook it is defined on.
@@ -154,12 +154,12 @@ const {
154154
- `initialDataUpdatedAt: number | (() => number | undefined)`
155155
- Optional
156156
- If set, this value will be used as the time (in milliseconds) of when the `initialData` itself was last updated.
157-
- `placeholderData: TData | (previousValue: TData | undefined; previousQuery: Query | undefined,) => TData`
157+
- `placeholderData: TData | (previousValue: TData | undefined, previousQuery: Query | undefined) => TData`
158158
- Optional
159159
- If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `pending` state.
160160
- `placeholderData` is **not persisted** to the cache
161161
- If you provide a function for `placeholderData`, as a first argument you will receive previously watched query data if available, and the second argument will be the complete previousQuery instance.
162-
- `structuralSharing: boolean | (oldData: unknown | undefined, newData: unknown) => unknown)`
162+
- `structuralSharing: boolean | (oldData: unknown | undefined, newData: unknown) => unknown`
163163
- Optional
164164
- Defaults to `true`
165165
- If set to `false`, structural sharing between query results will be disabled.
@@ -178,7 +178,7 @@ const {
178178

179179
**Parameter2 (QueryClient)**
180180

181-
- `queryClient?: QueryClient`,
181+
- `queryClient?: QueryClient`
182182
- Use this to use a custom QueryClient. Otherwise, the one from the nearest context will be used.
183183

184184
**Returns**

0 commit comments

Comments
 (0)