You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello @xian107. In order to facilitate location and troubleshooting, we need you to provide a realistic GitHub repository.
您好 @xian107, 为了方便定位和排查问题,我们需要您提供一个重现实例,请提供一个尽可能精简的 GitHub 仓库地址。
Since the issue was labeled with Need Reproduction, but no response in 7 days. This issue will be close. If you have any questions, you can comment and reply.
由于该 issue 被标记为需要可复现步骤,却 7 天未收到回应。现关闭 issue,若有任何问题,可评论回复。
hooks1:useEffect(() => { microApp.setData(name, {path:xxx} }, [location.pathname]);
hooks2:useEffect(() => { microApp.setData(name, {tabArrs:xxx} }, [tabArrs]);
hooks1执行后,hooks2执行了后倒置监听到的数据包含hooks1的path,把数据合并了,我在子应用无法知道哪些数据有更新。
改成:
hooks1:useEffect(() => { microApp.setData(name, {type:'path',payload:xxx} }, [location.pathname]);
hooks2:useEffect(() => { microApp.setData(name, {type:'tabArrs',,payload:xxx} }, [tabArrs]);
两个一起变化的时候,我在子应用只能拿到后面执行的type
请问我在子应用要怎么才能addDataListener到最新变化的值?不要之前的旧值
下面这种方法也不行,因为不确定hooks1和hooks2哪个先。都是用useEffect监听的,不在同一个组件里
microApp.setData('my-app', {city: 'HK'}, (res: any[]) => {
microApp.setData('my-app')
})
The text was updated successfully, but these errors were encountered: