Internal Babel helper for building React JSX AST nodes, used by @babel/plugin-transform-react-jsx and related plugins. This package provides a builder function that creates call expressions (e.g., React.createElement) from JSX AST elements. Version 6.26.0 is the latest stable release, part of Babel 6.x, which is now in maintenance mode. Key differentiator: it is strictly a Babel internals helper, not intended for direct consumer use. Alternatives: use @babel/plugin-transform-react-jsx directly for JSX transformation.
npm install babel-helper-builder-react-jsxVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to use the builder to replace JSXElement nodes with call expressions, including pre/post hooks.
Use @babel/plugin-transform-react-jsx directly for JSX transformation.
Use @babel/plugin-transform-react-jsx or @babel/plugin-transform-react-jsx-development in Babel 7+.
Ensure args is an array of AST nodes (not strings or objects).
Install the correct version: npm install babel-helper-builder-react-jsx@6 --save-dev, or switch to @babel/helper-builder-react-jsx for Babel 7+.
Use default import: import buildReactJSX from 'babel-helper-builder-react-jsx'
Use ESM import: import buildReactJSX from 'babel-helper-builder-react-jsx'