How to use the isJSXFragment function from @babel/types
Find comprehensive JavaScript @babel/types.isJSXFragment code examples handpicked from public code repositorys.
680 681 682 683 684 685 686 687 688 689
let returnsJSX = false; path.traverse({ ReturnStatement(path) { let ret = path.node.argument; if (t.isJSXElement(ret) || t.isJSXFragment(ret) || isReactCall(path.get('argument'), 'cloneElement') || isReactCall(path.get('argument'), 'createPortal', 'react-dom')) { returnsJSX = true; } } });
689
0
0
+ 461 other calls in file
511 512 513 514 515 516 517 518 519 520
if (path.isFunction()) { let returnsJSX = false; path.traverse({ ReturnStatement(path) { let ret = path.node.argument; if (t.isJSXElement(ret) || t.isJSXFragment(ret) || isReactCall(path.get("argument"), "cloneElement") || isReactCall(path.get("argument"), "createPortal", "react-dom")) { returnsJSX = true; } } });
0
1
0
+ 6 other calls in file
@babel/types.identifier is the most popular function in @babel/types (20936 examples)