DEV Community

loading...

Discussion on: Using MobX with React Hooks

Collapse
cbfn profile image
Christian Nascimento

Hi Ryan! How are you!

Thanks for the post. I Love it!

I'm studing modx to start a new project. So I would like to know if exists a better and modern way to share multiple stores with mobx. I dont know if my solution is good or not.

Here is my codesandbox with the example just to know if I'm in the right way.

Best regards

Collapse
ryands17 profile image
Ryan Dsouza Author

Hey Christian!

I'm glad you loved the post!

Yes this the way we use multiple stores at our organization as well, but if you want interoperability among the stores, I would suggest creating a RootStore that holds all of the other stores and you could then call a method of a store from another one. Otherwise, it looks great!

Collapse
cbfn profile image
Christian Nascimento

Thanks very much for the reply. I really appreciate it.

Best regards! ;-)