【发布时间】:2021-08-15 09:22:33
【问题描述】:
尝试将现有的 react + redux 应用程序迁移到微前端。
Container (Parent App) - localhost:8080
ReactReduxApp (Child App - 1) - localhost:8081
ReactApp (Child App - 2) - localhost:8082
独立应用程序可以在其 PORT 中使用 react-redux 运行。 当作为容器应用程序内的子应用程序访问它时,容器应用程序没有加载并抛出错误
Error: Could not find "store" in the context of "Connect(IndexPage)". Either wrap the root component in a <Provider>, or pass a custom React context provider to <Provider> and the corresponding React context consumer to Connect(IndexPage) in connect options.
没有 ReactReduxApp(Child1) 我的 Container(Parent) 应用在 ReactApp(Child2)
下运行良好【问题讨论】:
标签: reactjs redux react-redux webpack-5 webpack-module-federation