We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent da7ff59 commit 62289e5Copy full SHA for 62289e5
modules/code-generator/src/plugins/component/react/containerLifeCycle.ts
@@ -13,6 +13,7 @@ import {
13
IContainerInfo,
14
} from '../../../types';
15
import { isJSFunction, isJSExpression } from '@alilc/lowcode-types';
16
+import { isJSExpressionFn } from '../../../utils/common';
17
18
export interface PluginConfig {
19
fileType: string;
@@ -41,6 +42,7 @@ const pluginFactory: BuilderComponentPluginFactory<PluginConfig> = (config?) =>
41
42
// 过滤掉非法数据(有些场景下会误传入空字符串或 null)
43
if (
44
!isJSFunction(lifeCycles[lifeCycleName]) &&
45
+ !isJSExpressionFn(lifeCycles[lifeCycleName]) &&
46
!isJSExpression(lifeCycles[lifeCycleName])
47
) {
48
return null;
0 commit comments