fix: 修复 Page 组件快速切换可能的 warning 报错 Close: #6657

This commit is contained in:
2betop 2023-06-29 11:21:23 +08:00
parent 4fa2510d29
commit 8600320c29

View File

@ -34,7 +34,7 @@ import {
SchemaMessage
} from '../Schema';
import {SchemaRemark} from './Remark';
import {onAction} from 'mobx-state-tree';
import {isAlive, onAction} from 'mobx-state-tree';
import mapValues from 'lodash/mapValues';
import {resolveVariable} from 'amis-core';
import {buildStyle} from 'amis-core';
@ -409,7 +409,7 @@ export default class Page extends React.Component<PageProps> {
env.tracker({eventType: 'pageLoaded'}, this.props);
}
if (rendererEvent?.prevented) {
if (rendererEvent?.prevented || !isAlive(store)) {
return;
}