1. babel-plugin-transform-react-constant-elements
Treat React JSX elements as value types and hoist them to the highest scope
babel-plugin-transform-react-constant-elements
Package: babel-plugin-transform-react-constant-elements
Created by: babel
Last modified: Mon, 13 Jun 2022 04:05:08 GMT
Version: 6.23.0
License: MIT
Downloads: 305,136
Repository: https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-react-constant-elements

Install

npm install babel-plugin-transform-react-constant-elements
yarn add babel-plugin-transform-react-constant-elements

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

Via .babelrc (Recommended)

.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"]
});

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code