4

We're using custom hooks in our app to invoke automatic analytics/general hooks which using const user = useObserver(() => userStore.user); to dispatch analytics (lifecycles of components/general usages)

But I have seen that useObserver hook of mobx is deprecated:enter image description here

Couldn't find any pattern for mobx usage with custom hooks (hooks can't use observer), it seems like the proper way is to pass the state through a component useCustomHook(user); which is not clean if we need to do it all over our components in the app.

Wonder what is the right pattern to do so with usage of mobx state in custom hooks.

Thank you.

0 Answers0