Skip to content

Commit 4b7fd0e

Browse files
committed
docs: fix internal links
1 parent 980d08d commit 4b7fd0e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+139
-149
lines changed

‎docs/framework/react/community/tkdodos-blog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ id: tkdodos-blog
33
title: TkDodo's Blog
44
---
55

6-
TanStack Query maintainer [TkDodo](https://twitter.com/tkdodo) has a series of blog posts about using and working with the library. Some articles show general best practices, but most have an _opinionated_ point of view.
6+
TanStack Query maintainer [TkDodo](https://bsky.app/profile/tkdodo.eu) has a series of blog posts about using and working with the library. Some articles show general best practices, but most have an _opinionated_ point of view.
77

88
## [#1: Practical React Query](https://tkdodo.eu/blog/practical-react-query)
99

‎docs/framework/react/guides/advanced-ssr.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ export default function Posts() {
530530

531531
Now, your `getPosts` function can return e.g. `Temporal` datetime objects and the data will be serialized and deserialized on the client, assuming your transformer can serialize and deserialize those data types.
532532

533-
For more information, check out the [Next.js App with Prefetching Example](../../../../examples/react/nextjs-app-prefetching).
533+
For more information, check out the [Next.js App with Prefetching Example](../examples/react/nextjs-app-prefetching).
534534

535535
## Experimental streaming without prefetching in Next.js
536536

@@ -597,7 +597,7 @@ export function Providers(props: { children: React.ReactNode }) {
597597
}
598598
```
599599

600-
For more information, check out the [NextJs Suspense Streaming Example](../../../../examples/react/nextjs-suspense-streaming).
600+
For more information, check out the [NextJs Suspense Streaming Example](../examples/react/nextjs-suspense-streaming).
601601

602602
The big upside is that you no longer need to prefetch queries manually to have SSR work, and it even still streams in the result! This gives you phenomenal DX and lower code complexity.
603603

‎docs/framework/react/guides/caching.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ id: caching
33
title: Caching Examples
44
---
55

6-
> Please thoroughly read the [Important Defaults](./important-defaults) before reading this guide
6+
> Please thoroughly read the [Important Defaults](./important-defaults.md) before reading this guide
77
88
## Basic Example
99

@@ -23,7 +23,7 @@ Let's assume we are using the default `gcTime` of **5 minutes** and the default
2323
- A second instance of `useQuery({ queryKey: ['todos'], queryFn: fetchTodos })` mounts elsewhere.
2424
- Since the cache already has data for the `['todos']` key from the first query, that data is immediately returned from the cache.
2525
- The new instance triggers a new network request using its query function.
26-
- Note that regardless of whether both `fetchTodos` query functions are identical or not, both queries' [`status`](../reference/useQuery) are updated (including `isFetching`, `isPending`, and other related values) because they have the same query key.
26+
- Note that regardless of whether both `fetchTodos` query functions are identical or not, both queries' [`status`](../reference/useQuery.md) are updated (including `isFetching`, `isPending`, and other related values) because they have the same query key.
2727
- When the request completes successfully, the cache's data under the `['todos']` key is updated with the new data, and both instances are updated with the new data.
2828
- Both instances of the `useQuery({ queryKey: ['todos'], queryFn: fetchTodos })` query are unmounted and no longer in use.
2929
- Since there are no more active instances of this query, a garbage collection timeout is set using `gcTime` to delete and garbage collect the query (defaults to **5 minutes**).

‎docs/framework/react/guides/dependent-queries.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,6 @@ const usersMessages = useQueries({
9090

9191
## A note about performance
9292

93-
Dependent queries by definition constitutes a form of [request waterfall](../../../react/guides/request-waterfalls), which hurts performance. If we pretend both queries take the same amount of time, doing them serially instead of in parallel always takes twice as much time, which is especially hurtful when it happens on a client that has high latency. If you can, it's always better to restructure the backend APIs so that both queries can be fetched in parallel, though that might not always be practically feasible.
93+
Dependent queries by definition constitutes a form of [request waterfall](./request-waterfalls.md), which hurts performance. If we pretend both queries take the same amount of time, doing them serially instead of in parallel always takes twice as much time, which is especially hurtful when it happens on a client that has high latency. If you can, it's always better to restructure the backend APIs so that both queries can be fetched in parallel, though that might not always be practically feasible.
9494

9595
In the example above, instead of first fetching `getUserByEmail` to be able to `getProjectsByUser`, introducing a new `getProjectsByUserEmail` query would flatten the waterfall.

‎docs/framework/react/guides/important-defaults.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Out of the box, TanStack Query is configured with **aggressive but sane** defaul
3636

3737
Have a look at the following articles from our Community Resources for further explanations of the defaults:
3838

39-
- [Practical React Query](../community/tkdodos-blog#1-practical-react-query)
40-
- [React Query as a State Manager](../community/tkdodos-blog#10-react-query-as-a-state-manager)
39+
- [Practical React Query](../community/tkdodos-blog.md#1-practical-react-query)
40+
- [React Query as a State Manager](../community/tkdodos-blog.md#10-react-query-as-a-state-manager)
4141

4242
[//]: # 'Materials'

‎docs/framework/react/guides/initial-query-data.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ There are many ways to supply initial data for a query to the cache before you n
88
- Declaratively:
99
- Provide `initialData` to a query to prepopulate its cache if empty
1010
- Imperatively:
11-
- [Prefetch the data using `queryClient.prefetchQuery`](../../../react/guides/prefetching)
12-
- [Manually place the data into the cache using `queryClient.setQueryData`](../../../react/guides/prefetching)
11+
- [Prefetch the data using `queryClient.prefetchQuery`](./prefetching.md)
12+
- [Manually place the data into the cache using `queryClient.setQueryData`](./prefetching.md)
1313

1414
## Using `initialData` to prepopulate a query
1515

@@ -170,6 +170,6 @@ const result = useQuery({
170170

171171
## Further reading
172172

173-
For a comparison between `Initial Data` and `Placeholder Data`, have a look at the [Community Resources](../community/tkdodos-blog#9-placeholder-and-initial-data-in-react-query).
173+
For a comparison between `Initial Data` and `Placeholder Data`, have a look at the [Community Resources](../community/tkdodos-blog.md#9-placeholder-and-initial-data-in-react-query).
174174

175175
[//]: # 'Materials'

‎docs/framework/react/guides/invalidations-from-mutations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ const mutation = useMutation({
3636

3737
[//]: # 'Example2'
3838

39-
You can wire up your invalidations to happen using any of the callbacks available in the [`useMutation` hook](../mutations)
39+
You can wire up your invalidations to happen using any of the callbacks available in the [`useMutation` hook](./mutations.md)

‎docs/framework/react/guides/migrating-to-react-query-3.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ try {
103103

104104
Together, these provide the same experience as before, but with added control to choose which component trees you want to reset. For more information, see:
105105

106-
- [QueryErrorResetBoundary](../../reference/QueryErrorResetBoundary)
107-
- [useQueryErrorResetBoundary](../../reference/useQueryErrorResetBoundary)
106+
- [QueryErrorResetBoundary](../reference/QueryErrorResetBoundary.md)
107+
- [useQueryErrorResetBoundary](../reference/useQueryErrorResetBoundary.md)
108108

109109
### `QueryCache.getQuery()` has been replaced by `QueryCache.find()`.
110110

‎docs/framework/react/guides/migrating-to-react-query-4.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ Please note in the case of `TypeScript` you need to use `tsx` as the parser; oth
5858

5959
### Query Keys (and Mutation Keys) need to be an Array
6060

61-
In v3, Query and Mutation Keys could be a String or an Array. Internally, React Query has always worked with Array Keys only, and we've sometimes exposed this to consumers. For example, in the `queryFn`, you would always get the key as an Array to make working with [Default Query Functions](../default-query-function) easier.
61+
In v3, Query and Mutation Keys could be a String or an Array. Internally, React Query has always worked with Array Keys only, and we've sometimes exposed this to consumers. For example, in the `queryFn`, you would always get the key as an Array to make working with [Default Query Functions](./default-query-function.md) easier.
6262

63-
However, we have not followed this concept through to all apis. For example, when using the `predicate` function on [Query Filters](../filters) you would get the raw Query Key. This makes it difficult to work with such functions if you use Query Keys that are mixed Arrays and Strings. The same was true when using global callbacks.
63+
However, we have not followed this concept through to all apis. For example, when using the `predicate` function on [Query Filters](./filters.md) you would get the raw Query Key. This makes it difficult to work with such functions if you use Query Keys that are mixed Arrays and Strings. The same was true when using global callbacks.
6464

6565
To streamline all apis, we've decided to make all keys Arrays only:
6666

@@ -100,7 +100,7 @@ Please note in the case of `TypeScript` you need to use `tsx` as the parser; oth
100100

101101
### The idle state has been removed
102102

103-
With the introduction of the new [fetchStatus](../queries#fetchstatus) for better offline support, the `idle` state became irrelevant, because `fetchStatus: 'idle'` captures the same state better. For more information, please read [Why two different states](../queries#why-two-different-states).
103+
With the introduction of the new [fetchStatus](./queries.md#fetchstatus) for better offline support, the `idle` state became irrelevant, because `fetchStatus: 'idle'` captures the same state better. For more information, please read [Why two different states](./queries.md#why-two-different-states).
104104

105105
This will mostly affect `disabled` queries that don't have any `data` yet, as those were in `idle` state before:
106106

@@ -110,7 +110,7 @@ This will mostly affect `disabled` queries that don't have any `data` yet, as th
110110
+ fetchStatus: 'idle' // [!code ++]
111111
```
112112

113-
Also, have a look at [the guide on dependent queries](../dependent-queries)
113+
Also, have a look at [the guide on dependent queries](./dependent-queries.md)
114114

115115
#### disabled queries
116116

@@ -121,7 +121,7 @@ Due to this change, disabled queries (even temporarily disabled ones) will start
121121
isInitialLoading // [!code ++]
122122
```
123123

124-
See also the guide on [disabling queries](../disabling-queries#isInitialLoading)
124+
See also the guide on [disabling queries](./disabling-queries.md#isInitialLoading)
125125

126126
### new API for `useQueries`
127127

@@ -142,7 +142,7 @@ The `useQueries` hook now accepts an object with a `queries` prop as its input.
142142

143143
### Undefined is an illegal cache value for successful queries
144144

145-
In order to make bailing out of updates possible by returning `undefined`, we had to make `undefined` an illegal cache value. This is in-line with other concepts of react-query, for example, returning `undefined` from the [initialData function](../initial-query-data#initial-data-function) will also _not_ set data.
145+
In order to make bailing out of updates possible by returning `undefined`, we had to make `undefined` an illegal cache value. This is in-line with other concepts of react-query, for example, returning `undefined` from the [initialData function](./initial-query-data.md#initial-data-function) will also _not_ set data.
146146

147147
Further, it is an easy bug to produce `Promise<void>` by adding logging in the queryFn:
148148

@@ -156,7 +156,7 @@ This is now disallowed on type level; at runtime, `undefined` will be transforme
156156

157157
### Queries and mutations, per default, need network connection to run
158158

159-
Please read the [New Features announcement](#proper-offline-support) about online / offline support, and also the dedicated page about [Network mode](../network-mode)
159+
Please read the [New Features announcement](#proper-offline-support) about online / offline support, and also the dedicated page about [Network mode](./network-mode.md)
160160

161161
Even though React Query is an Async State Manager that can be used for anything that produces a Promise, it is most often used for data fetching in combination with data fetching libraries. That is why, per default, queries and mutations will be `paused` if there is no network connection. If you want to opt-in to the previous behavior, you can globally set `networkMode: offlineFirst` for both queries and mutations:
162162

@@ -217,7 +217,7 @@ queryClient.refetchQueries({ queryKey: ['todos'] }, { cancelRefetch: false })
217217
218218
### Query Filters
219219

220-
A [query filter](../filters) is an object with certain conditions to match a query. Historically, the filter options have mostly been a combination of boolean flags. However, combining those flags can lead to impossible states. Specifically:
220+
A [query filter](./filters.md) is an object with certain conditions to match a query. Historically, the filter options have mostly been a combination of boolean flags. However, combining those flags can lead to impossible states. Specifically:
221221

222222
```
223223
active?: boolean
@@ -242,7 +242,7 @@ The filter defaults to `all`, and you can choose to only match `active` or `inac
242242

243243
#### refetchActive / refetchInactive
244244

245-
[queryClient.invalidateQueries](../../../../reference/QueryClient/#queryclientinvalidatequeries) had two additional, similar flags:
245+
[queryClient.invalidateQueries](../../../reference/QueryClient.md#queryclientinvalidatequeries) had two additional, similar flags:
246246

247247
```
248248
refetchActive: Boolean
@@ -280,7 +280,7 @@ React.useEffect(() => mySideEffectHere(data), [data])
280280

281281
### `persistQueryClient` and the corresponding persister plugins are no longer experimental and have been renamed
282282

283-
The plugins `createWebStoragePersistor` and `createAsyncStoragePersistor` have been renamed to [`createSyncStoragePersister`](../../plugins/createSyncStoragePersister) and [`createAsyncStoragePersister`](../../plugins/createAsyncStoragePersister) respectively. The interface `Persistor` in `persistQueryClient` has also been renamed to `Persister`. Checkout [this stackexchange](https://english.stackexchange.com/questions/206893/persister-or-persistor) for the motivation of this change.
283+
The plugins `createWebStoragePersistor` and `createAsyncStoragePersistor` have been renamed to [`createSyncStoragePersister`](../plugins/createSyncStoragePersister.md) and [`createAsyncStoragePersister`](../plugins/createAsyncStoragePersister.md) respectively. The interface `Persistor` in `persistQueryClient` has also been renamed to `Persister`. Checkout [this stackexchange](https://english.stackexchange.com/questions/206893/persister-or-persistor) for the motivation of this change.
284284

285285
Since these plugins are no longer experimental, their import paths have also been updated:
286286

@@ -296,7 +296,7 @@ Since these plugins are no longer experimental, their import paths have also bee
296296
297297
### The `cancel` method on promises is no longer supported
298298
299-
The [old `cancel` method](../query-cancellation#old-cancel-function) that allowed you to define a `cancel` function on promises, which was then used by the library to support query cancellation, has been removed. We recommend to use the [newer API](../query-cancellation) (introduced with v3.30.0) for query cancellation that uses the [`AbortController` API](https://developer.mozilla.org/en-US/docs/Web/API/AbortController) internally and provides you with an [`AbortSignal` instance](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) for your query function to support query cancellation.
299+
The [old `cancel` method](./query-cancellation.md#old-cancel-function) that allowed you to define a `cancel` function on promises, which was then used by the library to support query cancellation, has been removed. We recommend to use the [newer API](./query-cancellation.md) (introduced with v3.30.0) for query cancellation that uses the [`AbortController` API](https://developer.mozilla.org/en-US/docs/Web/API/AbortController) internally and provides you with an [`AbortSignal` instance](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) for your query function to support query cancellation.
300300
301301
### TypeScript
302302
@@ -427,7 +427,7 @@ React Query defaults to "tracking" query properties, which should give you a nic
427427

428428
### Bailing out of updates with setQueryData
429429

430-
When using the [functional updater form of setQueryData](../../../../reference/QueryClient/#queryclientsetquerydata), you can now bail out of the update by returning `undefined`. This is helpful if `undefined` is given to you as `previousValue`, which means that currently, no cached entry exists and you don't want to / cannot create one, like in the example of toggling a todo:
430+
When using the [functional updater form of setQueryData](../../../reference/QueryClient.md#queryclientsetquerydata), you can now bail out of the update by returning `undefined`. This is helpful if `undefined` is given to you as `previousValue`, which means that currently, no cached entry exists and you don't want to / cannot create one, like in the example of toggling a todo:
431431

432432
```tsx
433433
queryClient.setQueryData(['todo', id], (previousTodo) =>

‎docs/framework/react/guides/migrating-to-v5.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ useQuery<number, string>({
218218
})
219219
```
220220

221-
For a way to set a different kind of Error globally, see [the TypeScript Guide](../../typescript#registering-a-global-error).
221+
For a way to set a different kind of Error globally, see [the TypeScript Guide](../typescript.md#registering-a-global-error).
222222

223223
### eslint `prefer-query-object-syntax` rule is removed
224224

@@ -480,7 +480,7 @@ if (queryInfo.data) {
480480
}
481481
```
482482

483-
Here, we are only changing how the UI looks when the mutation is running instead of writing data directly to the cache. This works best if we only have one place where we need to show the optimistic update. For more details, have a look at the [optimistic updates documentation](../optimistic-updates).
483+
Here, we are only changing how the UI looks when the mutation is running instead of writing data directly to the cache. This works best if we only have one place where we need to show the optimistic update. For more details, have a look at the [optimistic updates documentation](./optimistic-updates.md).
484484

485485
### Limited, Infinite Queries with new maxPages option
486486

@@ -494,21 +494,21 @@ Note that the infinite list must be bi-directional, which requires both `getNext
494494

495495
### Infinite Queries can prefetch multiple pages
496496

497-
Infinite Queries can be prefetched like regular Queries. Per default, only the first page of the Query will be prefetched and will be stored under the given QueryKey. If you want to prefetch more than one page, you can use the `pages` option. Read the [prefetching guide](../prefetching) for more information.
497+
Infinite Queries can be prefetched like regular Queries. Per default, only the first page of the Query will be prefetched and will be stored under the given QueryKey. If you want to prefetch more than one page, you can use the `pages` option. Read the [prefetching guide](./prefetching.md) for more information.
498498

499499
### New `combine` option for `useQueries`
500500

501-
See the [useQueries docs](../../reference/useQueries#combine) for more details.
501+
See the [useQueries docs](../reference/useQueries.md#combine) for more details.
502502

503503
### Experimental `fine grained storage persister`
504504

505-
See the [experimental_createPersister docs](../../../react/plugins/createPersister) for more details.
505+
See the [experimental_createPersister docs](../plugins/createPersister.md) for more details.
506506

507507
[//]: # 'FrameworkSpecificNewFeatures'
508508

509509
### Typesafe way to create Query Options
510510

511-
See the [TypeScript docs](../../typescript#typing-query-options) for more details.
511+
See the [TypeScript docs](../typescript.md#typing-query-options) for more details.
512512

513513
### new hooks for suspense
514514

@@ -524,6 +524,6 @@ const { data: post } = useSuspenseQuery({
524524

525525
The experimental `suspense: boolean` flag on the query hooks has been removed.
526526

527-
You can read more about them in the [suspense docs](../suspense).
527+
You can read more about them in the [suspense docs](./suspense.md).
528528

529529
[//]: # 'FrameworkSpecificNewFeatures'

0 commit comments

Comments
 (0)