
Security News
OWASP 2025 Top 10 Adds Software Supply Chain Failures, Ranked Top Community Concern
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.
babel-plugin-transform-react-jsx-self
Advanced tools
Adds
__selfprop to JSX elements, which React will use to generate some runtime warnings. All React users should enable this transform in dev mode.
In
<sometag />
Out
<sometag __self={this} />
npm install --save-dev babel-plugin-transform-react-jsx-self
.babelrc (Recommended).babelrc
{
"plugins": ["transform-react-jsx-self"]
}
babel --plugins transform-react-jsx-self script.js
require("babel-core").transform("code", {
plugins: ["transform-react-jsx-self"]
});
The babel-plugin-transform-react-jsx-source package is another Babel plugin that adds a `__source` prop to all JSX elements. This `__source` prop contains information about the filename and line number of the JSX element, which can be useful for debugging. Unlike babel-plugin-transform-react-jsx-self, which adds a `__self` prop, this plugin focuses on providing source location information.
The babel-plugin-react-display-name package automatically adds a `displayName` property to React component classes. This can be useful for debugging and development tools, as it makes it easier to identify components in the React component tree. While it does not add a `__self` prop like babel-plugin-transform-react-jsx-self, it serves a similar purpose of improving the developer experience by making components easier to identify.
FAQs
Add a __self prop to all JSX Elements
The npm package babel-plugin-transform-react-jsx-self receives a total of 424,563 weekly downloads. As such, babel-plugin-transform-react-jsx-self popularity was classified as popular.
We found that babel-plugin-transform-react-jsx-self demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.