是否有可能使用这种方法isolating SubApps与React路由器?
问题是每次路由更改时,SubApp将重新呈现,然后redux存储将断开连接。
class BigApp extends Component {
render() {
return (
<Router history={history} >
<Route component={SubApp1} />
<Route component={SubApp2} />
<Route component={SubApp3} />
</Router>
)
}
}
是。我有同样的问题。我解决它的方式是here。解决方案的关键是在每个子应用程序的根应用程序和本地存储上维护一个全局存储,并在它们之间使用Observer模式。