Skip to content

Commit 62289e5

Browse files
committed
fix: 修复 lifeCycles 无法正常出码
1 parent da7ff59 commit 62289e5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

modules/code-generator/src/plugins/component/react/containerLifeCycle.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
IContainerInfo,
1414
} from '../../../types';
1515
import { isJSFunction, isJSExpression } from '@alilc/lowcode-types';
16+
import { isJSExpressionFn } from '../../../utils/common';
1617

1718
export interface PluginConfig {
1819
fileType: string;
@@ -41,6 +42,7 @@ const pluginFactory: BuilderComponentPluginFactory<PluginConfig> = (config?) =>
4142
// 过滤掉非法数据(有些场景下会误传入空字符串或 null)
4243
if (
4344
!isJSFunction(lifeCycles[lifeCycleName]) &&
45+
!isJSExpressionFn(lifeCycles[lifeCycleName]) &&
4446
!isJSExpression(lifeCycles[lifeCycleName])
4547
) {
4648
return null;

0 commit comments

Comments
 (0)