Skip to content

Commit

Permalink
docs: add a note for useHydrateAtoms client code usage
Browse files Browse the repository at this point in the history
  • Loading branch information
KagamiChan committed Oct 3, 2024
1 parent d5bb477 commit fe09d65
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/utilities/ssr.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ const CounterPage = ({ countFromServer }) => {

The primary use case for `useHydrateAtoms` are SSR apps like Next.js, where an initial value is e.g. fetched on the server, which can be passed to a component by props.

⚠️ Note: Although the term "hydrate" might suggest server-side usage, this hook is designed for client-side code and should be used with the [`'use client'` directive](https://react.dev/reference/rsc/use-client).

```ts
// Definition
function useHydrateAtoms(
Expand Down

0 comments on commit fe09d65

Please sign in to comment.