From 37f5c095211f8826bb2251baebd1d879eca5df62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=8B=E3=81=8C=E3=81=BF?= Date: Fri, 4 Oct 2024 09:24:01 +0800 Subject: [PATCH] docs: add a note for useHydrateAtoms client code usage (#2761) --- docs/utilities/ssr.mdx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/utilities/ssr.mdx b/docs/utilities/ssr.mdx index 2d35d52656..346d54ae5b 100644 --- a/docs/utilities/ssr.mdx +++ b/docs/utilities/ssr.mdx @@ -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(