diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 76e8ed965d0..b165d2a4b90 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -350,7 +350,7 @@ export function createForm(options: IFormCreatorOptions = {}) { if ( unmountedChanged && (published.display !== false || published.visible === false) && - published.unmountRemoveValue + published.unmountRemoveValue === true ) { if (published.unmounted) { if (isValid(published.value)) { @@ -525,7 +525,6 @@ export function createForm(options: IFormCreatorOptions = {}) { dataPath, computeState, dataType, - unmountRemoveValue, useDirty: isValid(useDirty) ? useDirty : options.useDirty }) field.subscription = { @@ -548,6 +547,10 @@ export function createForm(options: IFormCreatorOptions = {}) { state.initialValue = formInitialValue } + if (isValid(unmountRemoveValue)) { + state.unmountRemoveValue = unmountRemoveValue + } + if (isValid(value)) { // value > formValue > initialValue state.value = value