Isolating Redux Sub-Apps
These s will be completely independent. They won't share data oractions, and won't see or communicate with each other.
It's best not to mix this approach with standard Redux reducer composition.For typical web apps, stick with reducer composition. For“product hubs”, “dashboards”, or enterprise software that groups disparatetools into a unified package, give the sub-app approach a try.
Below is a sub-app's root connected component.As usual, it can render more components, connected or not, as children.Usually we'd render it in and be done with it.
However, we don't have to call if we're interested in hiding the fact that the sub-app component is a Redux app.
To hide Redux behind a React API, we can wrap it in a special component thatinitializes the store in the constructor:
This way every instance will be independent.