Currently, I am using Redux and the mentioned hooks for react projects. However, useMemo
and useCallback
can quickly lead to bugs (tricky ones) very quickly in my opinion. As I understood, these hooks are required to avoid unnecessary re-rendering of components since react is checking referential equality.
I want to get rid of the above-mentioned hooks and let MobX handle all the reactive stuff. I wonder if I totally can get rid of them (useCallback
, useMemo
) and therefore everything updates automatically.
- Does MobX come with slower performance?
- Is it even possible to totally get rid of them with MobX?
- Can UI components also only relay on MobX (e.g. setting loading boolean or boolean for toggle modal visibility)?
Also, I read useContext
should not be used for high frequent updates. However, MobX is really often used with the hook (talking about mobx-react-lite
). So is it even a good idea to use MobX for UI updates?