Results 3 comments of 诚哥

这个方案我之前也尝试过了。刚刚看你这边处理,我也尝试了下,会有如下警告 主应用我是新建react进行引入相关功能的,在使用react18的时候,AppRoute组件无法监听路由变化,我重新更改到React17版本后,又是可以正常切换路由的。react18挂载之后,不能再次使用ReactDOM.createRoot进行重新挂载的

@maoxiaoke 主应用和微应用都是react18,切换的时候就一直会报这个错误,微应用独立运行没有问题。结合主应用就会报上面的错误。 同时根据API的配置,我配置了react17的,但是在主应用进入微应用某个页面,再微应用进入主应用的某个界面时就会报错,查看了都是卸载后更新了状态的原因,包括问题中的 https://micro-frontends.ice.work/error/?code=4&arg=microApp1&arg=unloadMicroApp 微应用重新返回到主应用页面的时候,就会拿不到微应用的注册,看了下微应用是空的数组 https://user-images.githubusercontent.com/29134803/167986159-c731f863-ecf2-4bb0-89e4-afc8fd8f27e4.mov 我的主应用是这么配置的: ![image](https://user-images.githubusercontent.com/29134803/167986513-f01b70a9-9d85-4d98-9ec7-d7d4292f9561.png) ![image](https://user-images.githubusercontent.com/29134803/167986546-b7904980-3eee-400b-add5-8b95defc192a.png) 我的微应用是这么配置的 ![image](https://user-images.githubusercontent.com/29134803/167986577-41c6d59b-7fd1-4e6f-a5bc-aad3e9af0e10.png)

@maoxiaoke 好的,我看看,目前都是在新版本上会出现问题,在低版本的时候是正常的,只是不想使用相对低版本的。 目前还有一个问题,是使用react-router 6的版本,在使用AppRouter时的render是路由渲染是无效的无效的,降级下来的react-router是可以切换的,react-router6是使用Routes 和 Route组合,弃掉了Swift的 ![image](https://user-images.githubusercontent.com/29134803/168202866-dfd38803-7aba-48b2-af47-8f9209e82c90.png) 这种切换是无效的 ![image](https://user-images.githubusercontent.com/29134803/168202898-7dfdab0c-e8a0-454f-9169-d1f7d603a936.png)