How to use the @emotion/babel-utils.getTargetClassName function in @emotion/babel-utils

To help you get started, we’ve selected a few @emotion/babel-utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github emotion-js / next / packages / babel-plugin-core / src / styled-macro.js View on Github external
if (
            state.emotionSourceMap &&
            styledCallPath.node.quasi.loc !== undefined
          ) {
            sourceMap = getSourceMap(styledCallPath.node.quasi.loc.start, state)
          }
          styledCallPath.replaceWith(
            t.callExpression(styledCallPath.node.tag, expressions)
          )
        }
      }
      if (t.isCallExpression(reference.parentPath)) {
        reference.parentPath.node.arguments[1] = t.objectExpression([
          t.objectProperty(
            t.identifier('target'),
            t.stringLiteral(getTargetClassName(state, t))
          ),
          t.objectProperty(
            t.identifier('label'),
            t.stringLiteral(getLabelFromPath(reference.parentPath, t))
          )
        ])
      }
      if (t.isCallExpression(reference.parentPath.parentPath)) {
        if (state.emotionSourceMap) {
          if (
            !sourceMap &&
            reference.parentPath.parentPath.node.loc !== undefined
          ) {
            sourceMap = getSourceMap(
              reference.parentPath.parentPath.node.loc.start,
              state