useShallow - may be docs has broken example #3121
-
|
i m using react v19.1.0 with zustand 5.0.4, - doc link https://zustand.docs.pmnd.rs/guides/prevent-rerenders-with-use-shallow#example it throws error in browser console - codesandbox : https://codesandbox.io/p/devbox/stupefied-drake-hszyck |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
|
That's correct, because it shows the problematic code.
Maybe, it should clearly say it may cause infinite loop. What do you think? @dbritto-dev |
Beta Was this translation helpful? Give feedback.
-
|
i think, we only need to update the docs and provide the details of expected result of code, with current context its not clear. |
Beta Was this translation helpful? Give feedback.

That's correct, because it shows the problematic code.
Maybe, it should clearly say it may cause infinite loop. What do you think? @dbritto-dev