Skip to content

Commit

Permalink
Merge branch 'main' into bug-2738
Browse files Browse the repository at this point in the history
  • Loading branch information
dai-shi committed Oct 9, 2024
2 parents b94deb9 + f51553d commit 21d45e5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/utilities/family.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ This is crucial if you use infinite number of params.
There are two ways to remove params.

- `myFamily.remove(param)` allows you to remove a specific param.
- `myFamily.setShouldRemove(shouldRemove)` is to register `shouldRemove` function which runs immediately **and** when you are to get an atom from a cache.
- `myFamily.setShouldRemove(shouldRemove)` is to register `shouldRemove` function which runs immediately **and** when you are about to get an atom from a cache.
- shouldRemove is a function that takes two arguments `createdAt` in milliseconds and `param`, and returns a boolean value.
- setting `null` will remove the previously registered function.

Expand Down
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 21d45e5

Please sign in to comment.