fix: fix utils under appHelper will not be updated when props.appHelper is updated

This commit is contained in:
liujuping 2023-08-28 15:51:50 +08:00 committed by 林熠
parent 857685a3b4
commit dc0cf5f62c

View File

@ -131,7 +131,6 @@ export default function baseRendererFactory(): IBaseRenderComponent {
static contextType = AppContext;
appHelper?: IRendererAppHelper;
i18n: any;
getLocale: any;
setLocale: any;
@ -174,7 +173,6 @@ export default function baseRendererFactory(): IBaseRenderComponent {
__beforeInit(_props: IBaseRendererProps) { }
__init(props: IBaseRendererProps) {
this.appHelper = props.__appHelper;
this.__compScopes = {};
this.__instanceMap = {};
this.__bindCustomMethods(props);
@ -1019,6 +1017,10 @@ export default function baseRendererFactory(): IBaseRenderComponent {
return !isSchema(schema) || !componentNames.includes(schema?.componentName ?? '');
};
get appHelper(): IRendererAppHelper {
return this.props.__appHelper;
}
get requestHandlersMap() {
return this.appHelper?.requestHandlersMap;
}