remove 前先判断是否已经destroy
This commit is contained in:
parent
aaef9b7952
commit
7b125bb4f6
|
@ -32,6 +32,7 @@ import {dataMapping} from '../../utils/tpl-builtin';
|
||||||
import {isApiOutdated, isEffectiveApi} from '../../utils/api';
|
import {isApiOutdated, isEffectiveApi} from '../../utils/api';
|
||||||
import Spinner from '../../components/Spinner';
|
import Spinner from '../../components/Spinner';
|
||||||
import {LazyComponent} from '../../components';
|
import {LazyComponent} from '../../components';
|
||||||
|
import {isAlive} from 'mobx-state-tree';
|
||||||
export type FormGroup = FormSchema & {
|
export type FormGroup = FormSchema & {
|
||||||
title?: string;
|
title?: string;
|
||||||
className?: string;
|
className?: string;
|
||||||
|
@ -320,7 +321,7 @@ export default class Form extends React.Component<FormProps, object> {
|
||||||
store.parentStore.storeType === 'ComboStore'
|
store.parentStore.storeType === 'ComboStore'
|
||||||
) {
|
) {
|
||||||
const combo = store.parentStore as IComboStore;
|
const combo = store.parentStore as IComboStore;
|
||||||
combo.removeForm(store);
|
isAlive(combo) && combo.removeForm(store);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import {types, SnapshotIn} from 'mobx-state-tree';
|
import {types, SnapshotIn, isAlive} from 'mobx-state-tree';
|
||||||
import {iRendererStore} from './iRenderer';
|
import {iRendererStore} from './iRenderer';
|
||||||
import {FormItemStore, IFormItemStore} from './formItem';
|
import {FormItemStore, IFormItemStore} from './formItem';
|
||||||
import {FormStore, IFormStore} from './form';
|
import {FormStore, IFormStore} from './form';
|
||||||
|
|
Loading…
Reference in New Issue