mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2025-12-12 19:52:51 +00:00
fix: default FaultComponent can not get componentName (#2385)
This commit is contained in:
parent
82ecee98c5
commit
4128654347
@ -135,10 +135,12 @@ export default function rendererFactory(): IRenderComponent {
|
|||||||
return engine.createElement(engine.getFaultComponent(), {
|
return engine.createElement(engine.getFaultComponent(), {
|
||||||
...this.props,
|
...this.props,
|
||||||
error: this.state.error,
|
error: this.state.error,
|
||||||
|
componentName: this.props._componentName
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return originRender.call(this);
|
return originRender.call(this);
|
||||||
};
|
};
|
||||||
|
if(!(SetComponent.prototype instanceof PureComponent)) {
|
||||||
const originShouldComponentUpdate = SetComponent.prototype.shouldComponentUpdate;
|
const originShouldComponentUpdate = SetComponent.prototype.shouldComponentUpdate;
|
||||||
SetComponent.prototype.shouldComponentUpdate = function (nextProps: IRendererProps, nextState: any) {
|
SetComponent.prototype.shouldComponentUpdate = function (nextProps: IRendererProps, nextState: any) {
|
||||||
if (nextState && nextState.engineRenderError) {
|
if (nextState && nextState.engineRenderError) {
|
||||||
@ -147,6 +149,7 @@ export default function rendererFactory(): IRenderComponent {
|
|||||||
return originShouldComponentUpdate ? originShouldComponentUpdate.call(this, nextProps, nextState) : true;
|
return originShouldComponentUpdate ? originShouldComponentUpdate.call(this, nextProps, nextState) : true;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
createElement(SetComponent: any, props: any, children?: any) {
|
createElement(SetComponent: any, props: any, children?: any) {
|
||||||
// TODO: enable in runtime mode?
|
// TODO: enable in runtime mode?
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user