Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

babel-plugin-transform-react-constant-elements

babel275.1kMIT6.23.0

Treat React JSX elements as value types and hoist them to the highest scope

babel-plugin

readme

babel-plugin-transform-react-constant-elements

Treat React JSX elements as value types and hoist them to the highest scope

Installation

$ npm install babel-plugin-transform-react-constant-elements

Usage

.babelrc

{
  "plugins": ["transform-react-constant-elements"]
}

Via CLI

$ babel --plugins transform-react-constant-elements script.js

Via Node API

require("babel-core").transform("code", {
  plugins: ["transform-react-constant-elements"]
});