Skip to content

Commit

Permalink
Doc updats
Browse files Browse the repository at this point in the history
  • Loading branch information
brophdawg11 committed Dec 5, 2023
1 parent ca5c0ce commit 3da944e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/route/client-loader.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ export default function Component() {

### `clientLoader.hydrate`

If you need to run your `clientLoader` on hydration, you can opt-into that by setting `clientLoader.hydrate=true`. This will tell Remix that it needs to run the `clientLoader` on hydration. Without a `HydrateFallback`, your route componen t will be SSr'd with the server loader data - so if you opt-into running the `clientLoader` on hydration - it's will run and the returned data will be updated in-place in the hydrated route Component.
If you need to run your `clientLoader` on hydration, you can opt-into that by setting `clientLoader.hydrate=true`. This will tell Remix that it needs to run the `clientLoader` on hydration. Without a `HydrateFallback`, your route component will be SSR'd with the server loader data - and then `clientLoader` will run and the returned data will be updated in-place in the hydrated route Component.

<docs-info>If a route exports a `clientLoader` and does not export a server `loader`, then `clientLoader.hydrate` is automatically treated as `true` since there is no server data to SSR with. Therefore, we always need to run the `clientLoader` on hydration before rendering the route component.</docs-info>

### HydrateFallback

If you need to avoid rendering your default route component during SSR because you have data that must come from a `clientLoader`, you can export a [`HydrateFallback`][hydratefallback] component from your route that will be rendered during SSR, and only once the clientLoader runs on hydration will your router component be rendered.
If you need to avoid rendering your default route component during SSR because you have data that must come from a `clientLoader`, you can export a [`HydrateFallback`][hydratefallback] component from your route that will be rendered during SSR, and only once the `clientLoader` runs on hydration will your router component be rendered.

## Arguments

Expand Down

0 comments on commit 3da944e

Please sign in to comment.