-
Hello! Been a long time since I was using MST and I want to come back, but looking at some community examples it looks kinda tedious when you're used to the standard hooks and zustand. Do I really need a Provider + hook AND the observer HOC? The React integration page doesn't even mention hooks. I would want to just be able to use a hook in the components I need the data. Is that possible? Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
You have to wrap your state in
It's up to you how you get state into your component - react context/import/local state.
No, because we have to wrap over rendering logic. Also it's no more tedious than using |
Beta Was this translation helpful? Give feedback.
You have to wrap your state in
observable
and your components inobserver
. In exchange, you don't have to worry about immutability, memoization, selectors, reducers, subscriptions.It's up to you how you get state into your component - react context/import/local state.
No, because we have to wrap over rendering logic. Also it's no more tedious than using
React.memo
, which you would have to use anyway to achieve similar perf benefits.