From f08cdcabfbef6833bbe2139bf953865e652672c5 Mon Sep 17 00:00:00 2001 From: zhiyuanzmj <260480378@qq.com> Date: Sat, 7 Dec 2024 21:57:07 +0800 Subject: [PATCH] fix: exclude TemplateLiteral expression from isConstant --- packages/babel-plugin-jsx/src/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/babel-plugin-jsx/src/utils.ts b/packages/babel-plugin-jsx/src/utils.ts index 6e1d24d..d1c35b6 100644 --- a/packages/babel-plugin-jsx/src/utils.ts +++ b/packages/babel-plugin-jsx/src/utils.ts @@ -323,7 +323,7 @@ export const isConstant = ( isConstant((property as any).value) ); } - if (t.isLiteral(node)) { + if (t.isLiteral(node) && !t.isTemplateLiteral(node)) { return true; } return false;