Skip to content

Commit

Permalink
docs: add back ticks and adjust wording
Browse files Browse the repository at this point in the history
  • Loading branch information
brookslybrand committed Dec 8, 2023
1 parent 80a624b commit 96eb33b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/route/client-action.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const clientAction = async ({

This function is only ever run on the client, and can be used in a few ways:

- Instead of a server action for full-client routes
- Instead of a server `action` for full-client routes
- To use alongside a `clientLoader` cache by invalidating the cache on mutations
- To facilitate a migration from React Router

Expand Down
6 changes: 3 additions & 3 deletions docs/route/client-loader.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const clientLoader = async ({

This function is only ever run on the client, and can be used in a few ways:

- Instead of a server loader for full-client routes
- Instead of a server `loader` for full-client routes
- To use alongside a `clientLoader` cache by invalidating the cache on mutations
- Maintaining a client-side cache to skip calls to the server
- Bypassing the Remix [BFF][bff] hop and hitting your API directly from the client
Expand Down Expand Up @@ -58,7 +58,7 @@ 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 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.
If you need to run your `clientLoader` on hydration, you can opt-in 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>

Expand All @@ -78,7 +78,7 @@ This function receives the same [`request`][loader-request] argument as a [`load

### `serverLoader`

`serverLoader` is an asynchronous function to get the data from the server `loader` for this route. On client-side navigations, this will make a [fetch][fetch] call to the Remix server loader. If you opt-into running your `clientLoader` on hydration, then this function will return you the data that was already loaded on the server (via `Promise.resolve`).
`serverLoader` is an asynchronous function to get the data from the server `loader` for this route. On client-side navigations, this will make a [fetch][fetch] call to the Remix server `loader`. If you opt-into running your `clientLoader` on hydration, then this function will return you the data that was already loaded on the server (via `Promise.resolve`).

See also:

Expand Down

0 comments on commit 96eb33b

Please sign in to comment.