From eb1a917670c3b57157928ca1e6a19f65f399b38b Mon Sep 17 00:00:00 2001 From: 2betop <2698393+2betop@users.noreply.github.com> Date: Mon, 18 Nov 2024 17:34:43 +0800 Subject: [PATCH] =?UTF-8?q?context=20=E6=9B=B4=E6=96=B0=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/amis-core/src/RootRenderer.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/amis-core/src/RootRenderer.tsx b/packages/amis-core/src/RootRenderer.tsx index 7b5967af0..b271f461c 100644 --- a/packages/amis-core/src/RootRenderer.tsx +++ b/packages/amis-core/src/RootRenderer.tsx @@ -74,10 +74,6 @@ export class RootRenderer extends React.Component { componentDidUpdate(prevProps: RootRendererProps) { const props = this.props; - if (props.data !== prevProps.data) { - this.store.initData(props.data); - } - if (props.location !== prevProps.location) { this.store.updateLocation(props.location, this.props.env?.parseLocation); } @@ -85,6 +81,10 @@ export class RootRenderer extends React.Component { if (props.context !== prevProps.context) { this.store.updateContext(props.context); } + + if (props.data !== prevProps.data) { + this.store.initData(props.data); + } } componentDidCatch(error: any, errorInfo: any) {