How to use the isJSXNamespacedName function from @babel/types

Find comprehensive JavaScript @babel/types.isJSXNamespacedName code examples handpicked from public code repositorys.

50
51
52
53
54
55
56
57
58
59
const attrPath = this.path.get(`openingElement.attributes.${index}`);
if (t.isJSXAttribute(attrPath.node)) {
  // 使用命名空间的属性
  if (
    hasNamespace
    && t.isJSXNamespacedName(attrPath.node.name)
    && attrPath.node.name.namespace === ns[0]
    && attrPath.node.name.name === ns[1]
  ) {
    return attrPath;
fork icon13
star icon89
watch icon4

+ 21 other calls in file

31
32
33
34
35
36
37
38
39
if (lang === 'vue' && (['wx', 'qq', 'baidu', 'alipay', 'tt'].includes(type))) {
  let parentPath = path.parentPath;
  let attributes = parentPath.node.attributes;
  let idNode = attributes.find((attr) => attr.name.name === 'id');
  let refNode = attributes.find((attr) => (attr.name.name === 'ref' || attr.name.name.name === 'ref'));
  let isDynamicRef = t.isJSXNamespacedName(refNode.name);
  let refNodeValue = isDynamicRef ? `{{${refNode.value.value}}}` : refNode.value.value
  let classNode = attributes.find((attr) => attr.name.name === 'class');
  if (idNode) {
fork icon699
star icon0
watch icon239

+ 11 other calls in file

Other functions in @babel/types

Sorted by popularity

function icon

@babel/types.identifier is the most popular function in @babel/types (20936 examples)