Skip to content

Commit

Permalink
docs: more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
SeanCassiere committed Dec 6, 2024
1 parent 15c938c commit c23b63d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/framework/react/guide/deferred-data-loading.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ TanStack Router is designed to run loaders in parallel and wait for all of them

Deferred data loading is a pattern that allows the router to render the next location's critical data/markup while slower, non-critical route data is resolved in the background. This process works on both the client and server (via streaming) and is a great way to improve the perceived performance of your application.

If you are using a library like [TanStack Query](https://react-query.tanstack.com) or any other data fetching library, thn deferred data loading works a bit differently. Skip ahead to the [Deferred Data Loading with External Libraries](#deferred-data-loading-with-external-libraries) section for more information.
If you are using a library like [TanStack Query](https://react-query.tanstack.com) or any other data fetching library, then deferred data loading works a bit differently. Skip ahead to the [Deferred Data Loading with External Libraries](#deferred-data-loading-with-external-libraries) section for more information.

## Deferred Data Loading with `defer` and `Await`

Expand All @@ -20,7 +20,7 @@ import { createFileRoute, defer } from '@tanstack/react-router'

export const Route = createFileRoute('/posts/$postId')({
loader: async () => {
// Kick off the fetching for some slower data, but do not await it
// Fetch some slower data, but do not await it
const slowDataPromise = fetchSlowData()

// Fetch and await some data that resolves quickly
Expand Down Expand Up @@ -85,7 +85,7 @@ import { slowDataOptions, fastDataOptions } from '~/api/query-options'

export const Route = createFileRoute('/posts/$postId')({
loader: async ({ context: { queryClient } }) => {
// Fetch some slower data, but do not await it
// Kick off the fetching of some slower data, but do not await it
queryClient.prefetchQuery(slowDataOptions())

// Fetch and await some data that resolves quickly
Expand Down

0 comments on commit c23b63d

Please sign in to comment.