How to use the isJSXExpressionContainer function from @babel/types
Find comprehensive JavaScript @babel/types.isJSXExpressionContainer code examples handpicked from public code repositorys.
GitHub: alijk-fe/motor-rax
![alijk-fe profile picture](/alijk-fe.png?size=40)
30 31 32 33 34 35 36 37 38 39
case directiveIf: case directiveElseif: case directiveElse: return { type: conditionTypes[attributes[i].name.name], value: t.isJSXExpressionContainer(attributes[i].value) ? attributes[i].value.expression : attributes[i].value, index: i, };
+ 7 other calls in file
GitHub: startupjs/startupjs
![startupjs profile picture](/startupjs.png?size=40)
112 113 114 115 116 117 118 119 120
// Check if styleName exists and if it can be processed if (styleName != null) { if (!( t.isStringLiteral(styleName.node.value) || t.isJSXExpressionContainer(styleName.node.value) )) { throw jsxOpeningElementPath.buildCodeFrameError(` styleName attribute has an unsupported type. It must be either a string or an expression.
+ 15 other calls in file
GitHub: caiwuu/Typex
![caiwuu profile picture](/caiwuu.png?size=40)
83 84 85 86 87 88 89 90 91 92
} else { return t.stringLiteral(node.name.name) } } function convertAttrValue(node) { return t.isJSXExpressionContainer(node.value) ? node.value.expression : node.value ? t.stringLiteral(node.value.value) : t.booleanLiteral(true)
GitHub: menhal/anu
![menhal profile picture](/menhal.png?size=40)
159 160 161 162 163 164 165 166 167 168
getAnu(state: any) { return state.file.opts.anu; }, isLoopMap(astPath: any) { if ( t.isJSXExpressionContainer(astPath.parentPath) || t.isConditionalExpression(astPath.parentPath) || t.isLogicalExpression(astPath.parentPath) ) { var callee = astPath.node.callee;
+ 3 other calls in file
115 116 117 118 119 120 121 122 123 124 125 126 127
}; } const idOrNull = attr => t.isStringLiteral(attr) ? attr.value : null; const expressionOrNull = attr => t.isJSXExpressionContainer(attr) ? attr.expression : null; function genStoryExport(ast, context) { const storyName = idOrNull(getAttr(ast.openingElement, 'name')); const storyId = idOrNull(getAttr(ast.openingElement, 'id'));
198 199 200 201 202 203 204 205 206 207
initTemplate(child, element, attrsCollector); }); } if ( t.isJSXExpressionContainer(wrappedElement) || t.isJSXText(wrappedElement) ) { ast = t.jSXElement( t.jSXOpeningElement(t.jSXIdentifier("div"), []),
+ 44 other calls in file
@babel/types.identifier is the most popular function in @babel/types (20936 examples)