diff --git a/docs/extensions/query.mdx b/docs/extensions/query.mdx index 05026b8ae1..efe3dc6e8b 100644 --- a/docs/extensions/query.mdx +++ b/docs/extensions/query.mdx @@ -263,6 +263,8 @@ Although they reference methods same query key (`'todos'`), the `onSuccess` inva This will result in `todosAtom` showing stale data as it was not prompted to refetch. +⚠️ Note: When using **Typescript**, it is recommended to use a Map when passing the queryClient value to useHydrateAtoms. You can find a working example in the [Initializing State on Render docs](https://jotai.org/docs/guides/initialize-atom-on-render#using-typescript) + ```jsx import { Provider } from 'jotai/react' import { useHydrateAtoms } from 'jotai/react/utils' diff --git a/docs/utilities/ssr.mdx b/docs/utilities/ssr.mdx index 346d54ae5b..cb76f49be2 100644 --- a/docs/utilities/ssr.mdx +++ b/docs/utilities/ssr.mdx @@ -90,6 +90,8 @@ useHydrateAtoms([ ] as const) ``` +Or you may need to use a Map when passing the atom value to useHydrateAtoms. You can find a working example in the [Initializing State on Render docs](https://jotai.org/docs/guides/initialize-atom-on-render#using-typescript). + ### Demo