-
Hello. When I was checking the community comments, I saw that the recommended writing style was the following: createWithEqualityFn((state)=>{}, shallow); However, I am mentioned on the home page and in the documentation, is the following way: useStore(useShallow((state) => [state.X1,state.X2])); Which one should I use? Or are the two usages serving different purposes? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
Both are introduced in v4 and will stay in v5. |
Beta Was this translation helpful? Give feedback.
-
I created useShallowStore hook to pick any state with just array and TS support. Do you think it's good practise? @dai-shi |
Beta Was this translation helpful? Give feedback.
Both are introduced in v4 and will stay in v5.
useShallow is newer and is basically recommended.
Basically we want to collect more feedback on them.