
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-constant-elements
Advanced tools
Treat React JSX elements as value types and hoist them to the highest scope
Treat React JSX elements as value types and hoist them to the highest scope
See our website @babel/plugin-transform-react-constant-elements for more information.
Using npm:
npm install --save-dev @babel/plugin-transform-react-constant-elements
or using yarn:
yarn add @babel/plugin-transform-react-constant-elements --dev
v7.27.1 (2025-04-30)
babel-parser
babel-parser, babel-types
babel-plugin-proposal-destructuring-private, babel-plugin-proposal-do-expressions, babel-traverse
babel-helper-wrap-function, babel-plugin-transform-async-to-generator
babel-helper-remap-async-to-generator, babel-plugin-transform-async-to-generator
babel-helper-fixtures, babel-parser
babel-generator, babel-parser
babel-parser
babel-compat-data, babel-preset-env
babel-traverse
babel-generator
babel-plugin-bugfix-v8-spread-parameters-in-optional-chaining, babel-plugin-proposal-decorators, babel-plugin-transform-arrow-functions, babel-plugin-transform-class-properties, babel-plugin-transform-destructuring, babel-plugin-transform-object-rest-spread, babel-plugin-transform-optional-chaining, babel-plugin-transform-parameters, babel-traverse
babel-runtime-corejs2, babel-runtime-corejs3, babel-runtime
regenerator-runtime dep in @babel/runtime (@nicolo-ribaudo)babel-compat-data, babel-preset-env
babel-compat-data, babel-standalone
babel-register
@babel/register to cts (@liuxingbaoyu)babel-cli, babel-compat-data, babel-core, babel-generator, babel-helper-compilation-targets, babel-helper-fixtures, babel-helper-module-imports, babel-helper-module-transforms, babel-helper-plugin-test-runner, babel-helper-transform-fixture-test-runner, babel-helpers, babel-node, babel-parser, babel-plugin-transform-modules-amd, babel-plugin-transform-modules-commonjs, babel-plugin-transform-modules-systemjs, babel-plugin-transform-modules-umd, babel-plugin-transform-react-display-name, babel-plugin-transform-regenerator, babel-plugin-transform-runtime, babel-plugin-transform-typeof-symbol, babel-plugin-transform-typescript, babel-preset-env, babel-register, babel-standalone, babel-types
babel-plugin-transform-regenerator
babel-helpers, babel-plugin-transform-async-generator-functions, babel-plugin-transform-regenerator, babel-preset-env, babel-runtime-corejs3
babel-helpers, babel-plugin-transform-regenerator
babel-helpers
babel-helpers, babel-plugin-transform-modules-commonjs, babel-runtime-corejs3
interopRequireWildcard size (@liuxingbaoyu)babel-helpers, babel-plugin-transform-async-generator-functions, babel-plugin-transform-regenerator, babel-preset-env, babel-runtime-corejs3
regeneratorRuntime size (@liuxingbaoyu)This plugin transforms JSX elements to object literals like React.createElement and is similar to @babel/plugin-transform-react-constant-elements in that it aims to improve performance. However, it inlines elements instead of hoisting them, which can be beneficial in some cases but not as effective for elements that could be hoisted outside of a high-frequency render path.
This plugin removes unnecessary React propTypes from the production build. It is similar in its goal to optimize React applications for production by reducing bundle size, but it does not specifically optimize render performance like @babel/plugin-transform-react-constant-elements does.
This plugin converts React.Component classes that do not use state or lifecycle methods into functional components. While it also aims to optimize React components, it focuses on a different aspect of optimization by enabling potential function component optimizations rather than hoisting static elements.
FAQs
Treat React JSX elements as value types and hoist them to the highest scope
The npm package @babel/plugin-transform-react-constant-elements receives a total of 5,466,918 weekly downloads. As such, @babel/plugin-transform-react-constant-elements popularity was classified as popular.
We found that @babel/plugin-transform-react-constant-elements demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 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.