mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:48:45 +08:00
fix: 修复获取 context 数据过时的问题
This commit is contained in:
parent
1b17c395ae
commit
cd1093f38b
@ -95,10 +95,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);
|
||||
}
|
||||
@ -106,6 +102,11 @@ export class RootRenderer extends React.Component<RootRendererProps> {
|
||||
if (props.context !== prevProps.context) {
|
||||
this.store.updateContext(props.context);
|
||||
}
|
||||
|
||||
// 一定要最后处理,否则 downStream 里面的上层数据 context 还是老的。
|
||||
if (props.data !== prevProps.data) {
|
||||
this.store.initData(props.data);
|
||||
}
|
||||
}
|
||||
|
||||
componentDidCatch(error: any, errorInfo: any) {
|
||||
|
Loading…
Reference in New Issue
Block a user