Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
dai-shi committed Aug 15, 2024
1 parent e9b4e20 commit 33b04d4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/how-tos/some-gotchas.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ This is technically same as the previous one. It doesn't touch the property of `

In summary, if a snapshot object (nested or not) is not accessed with any properties, it assumes the entire object is accessed, so any change inside the object will trigger re-render.

## Using `React.memo` with object props may result in unexpected behavior
## Using `React.memo` with object props may result in unexpected behavior (v1 only)

⚠️ This behavior is fixed in v2.

The `snap` variable returned by `useSnapshot(state)` is tracked for render optimization.
If you pass the `snap` or some objects in `snap` to a component with `React.memo`,
Expand Down

0 comments on commit 33b04d4

Please sign in to comment.