mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 10:38:16 +08:00
context 更新问题优化
This commit is contained in:
parent
2cb217aa36
commit
eb1a917670
@ -74,10 +74,6 @@ export class RootRenderer extends React.Component<RootRendererProps> {
|
||||
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<RootRendererProps> {
|
||||
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) {
|
||||
|
Loading…
Reference in New Issue
Block a user