@babel/types#JSXNamespacedName TypeScript Examples

The following examples show how to use @babel/types#JSXNamespacedName. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: index.ts    From plasmic with MIT License 6 votes vote down vote up
serializeNamedAttribute = (
  attrName: JSXIdentifier | JSXNamespacedName,
  rawValue: PlasmicASTNode | null | undefined,
  codeVersions: CodeVersions
) => {
  const attrValue = rawValue
    ? serializePlasmicASTNode(rawValue, codeVersions)
    : undefined;
  return babel.types.jsxAttribute(attrName, wrapAsJsxAttrValue(attrValue));
}
Example #2
Source File: visitor.ts    From react-dev-inspector with MIT License 6 votes vote down vote up
doJSXPathName: NodeHandler<JSXOpeningElement['name']> = (name) => {
  const visitors: { [key in ElementTypes]: NodeHandler } = {
    JSXIdentifier: doJSXIdentifierName,
    JSXMemberExpression: doJSXMemberExpressionName,
    JSXNamespacedName: doJSXNamespacedNameName,
  }

  return visitors[name.type](name)
}
Example #3
Source File: visitor.ts    From react-dev-inspector with MIT License 5 votes vote down vote up
doJSXNamespacedNameName: NodeHandler<JSXNamespacedName> = (name) => {
  return doJSXIdentifierName(name.name)
}