From c23b63d97bf94ce5c021b2c614de40105721a5c6 Mon Sep 17 00:00:00 2001 From: SeanCassiere <33615041+SeanCassiere@users.noreply.github.com> Date: Sat, 7 Dec 2024 12:07:56 +1300 Subject: [PATCH] docs: more fixes --- docs/framework/react/guide/deferred-data-loading.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/framework/react/guide/deferred-data-loading.md b/docs/framework/react/guide/deferred-data-loading.md index b7a8371aa1..ac296b8fd0 100644 --- a/docs/framework/react/guide/deferred-data-loading.md +++ b/docs/framework/react/guide/deferred-data-loading.md @@ -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` @@ -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 @@ -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