DEV Community


Discussion on: Mobx Root Store Pattern with React Hooks

ivandotv profile image
Ivan V. Author

This pattern is safe if that is what you are asking. Yes the stores are referencing each other, but there are no memory leaks. You could also create a special class (service) that would handle out the references to other stores service.getStoreA() or service.getStore('A') and pass that class to child stores instead of the root store.