From f55bf24b83b46332bf1e60ecfb9b29350f98c079 Mon Sep 17 00:00:00 2001 From: Sarun Yantabutr Date: Thu, 22 Feb 2024 16:26:03 +0700 Subject: [PATCH] fix: isReactNode check include jsx (#5) --- src/utils/magicString/react/isReactNode/index.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/utils/magicString/react/isReactNode/index.ts b/src/utils/magicString/react/isReactNode/index.ts index aa456b1..00873ed 100644 --- a/src/utils/magicString/react/isReactNode/index.ts +++ b/src/utils/magicString/react/isReactNode/index.ts @@ -3,8 +3,7 @@ export default function isReactNode(node: Record) { node?.callee?.object?.name === 'React' && node?.callee?.property?.name === 'createElement' const isJsxAndNotFragment = - (node?.callee?.name === 'jsxDEV' || node?.callee?.name === 'jsx') && - node?.arguments?.[0]?.name !== 'Fragment' + node?.callee?.name?.include?.('jsx') && node?.arguments?.[0]?.name !== 'Fragment' return isReactCreateElement || isJsxAndNotFragment }