How to use the JSXExpressionContainer function from @babel/types

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

70
71
72
73
74
75
76
77
78
79
},
JSXText(path) {
  const { node } = path;
  if (judgeChinese(node.value)) {
    path.replaceWith(
      t.JSXExpressionContainer(makeReplace({
        value: node.value.trim().replace(/\n\s+/g, "\n")
      }))
    );
  }
fork icon19
star icon62
watch icon2

108
109
110
111
112
113
114
115
116
117
  // 值是否包含中文
  if (baseUtils.isChinese(node.value.value)) {
    // 过滤特殊属性
    if (!options.ignoreTagAttr.includes(node.name.name)) {
      // 改为动态属性 
      node.value = t.JSXExpressionContainer(StringLiteral(node.value.value))
    }
  }
}
// path.skip() // 跳过子节点
fork icon0
star icon0
watch icon0

Other functions in @babel/types

Sorted by popularity

function icon

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