From 9f133858c50383e41f309013e93e9d7a93ebc181 Mon Sep 17 00:00:00 2001 From: Amour1688 Date: Wed, 15 Jul 2020 19:27:49 +0800 Subject: [PATCH] fix: directive with single param did not work --- packages/babel-plugin-jsx/src/parseDirectives.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/babel-plugin-jsx/src/parseDirectives.ts b/packages/babel-plugin-jsx/src/parseDirectives.ts index cdc0c22..30c09ea 100644 --- a/packages/babel-plugin-jsx/src/parseDirectives.ts +++ b/packages/babel-plugin-jsx/src/parseDirectives.ts @@ -79,7 +79,7 @@ const parseDirectives = (args: { arg, directive: hasDirective ? [ resolveDirective(path, state, tag, directiveName), - val as t.Identifier, + val || value, !!modifiersSet.size && t.unaryExpression('void', t.numericLiteral(0), true), !!modifiersSet.size && t.objectExpression( [...modifiersSet].map(