diff --git a/src/factory.tsx b/src/factory.tsx index 2f5818faf..fef67a2fe 100644 --- a/src/factory.tsx +++ b/src/factory.tsx @@ -728,19 +728,20 @@ export function HocStoreFactory(renderer: { ); } else if (isObjectShallowModified(props.data, nextProps.data)) { if (nextProps.store && nextProps.store.data === nextProps.data) { - const newData = createObject( + const diff = syncDataFromSuper( + store.data, nextProps.store.data, - syncDataFromSuper( - store.data, - nextProps.store.data, - props.scope, - nextProps.dataUpdatedAt !== props.dataUpdatedAt, - store - ) + props.scope, + nextProps.dataUpdatedAt !== props.dataUpdatedAt, + store ); - // todo fix: dialog 种数据从孩子 form 同步过来后,会走这个逻辑让 form 更新 data,会导致里面的 __prev 丢失。 - store.initData(newData); + if (Object.keys(diff).length) { + const newData = createObject(nextProps.store.data, diff); + + // todo fix: dialog 种数据从孩子 form 同步过来后,会走这个逻辑让 form 更新 data,会导致里面的 __prev 丢失。 + store.initData(newData); + } } else if (nextProps.data && (nextProps.data as any).__super) { store.initData(extendObject(nextProps.data)); } else {