1. babel-plugin-transform-react-jsx-self
Add a __self prop to all JSX Elements
babel-plugin-transform-react-jsx-self
Package: babel-plugin-transform-react-jsx-self
Created by: babel
Last modified: Fri, 21 Jul 2023 15:42:34 GMT
Version: 6.22.0
License: MIT
Downloads: 1,800,565
Repository: https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-react-jsx-self

Install

npm install babel-plugin-transform-react-jsx-self
yarn add babel-plugin-transform-react-jsx-self

babel-plugin-transform-react-jsx-self

Adds __self prop to JSX elements, which React will use to generate some runtime warnings. All React users
should enable this transform in dev mode.

Example

###In

<sometag />

###Out

<sometag __self={this} />

Installation

 $ npm install babel-plugin-transform-react-jsx-self

Usage

Via .babelrc (Recommended)

.babelrc

 {
  "plugins": ["transform-react-jsx-self"]
}

Via CLI

 $ babel --plugins transform-react-jsx-self script.js

Via Node API

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

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