Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
@babel/preset-react
Advanced tools
The @babel/preset-react npm package is a Babel preset that can be used to transform JSX into standard JavaScript. It is commonly used in React applications to allow developers to write JSX, which is a syntax extension for JavaScript that looks similar to HTML. This preset includes the necessary Babel plugins to parse and transform JSX syntax.
Transform JSX
Converts JSX syntax into createElement calls which are understood by React.
const element = <div>Hello, world!</div>;
Support for React Fragments
Allows the use of React Fragments to group a list of children without adding extra nodes to the DOM.
const element = <><div>Item 1</div><div>Item 2</div></>;
Support for JSX Spread Attributes
Enables the spreading of attributes in JSX elements from an object.
const props = { firstName: 'John', lastName: 'Doe' }; const element = <div {...props} />;
Support for JSX Expression Containers
Allows embedding expressions in JSX by wrapping them in curly braces.
const name = 'world'; const element = <div>Hello, {name}!</div>;
This package is similar to @babel/preset-react but is specifically tailored for Create React App projects. It includes additional Babel plugins and configurations suitable for the React scripts bundled with Create React App.
This preset is designed for hot module replacement in React applications during development. It is not a direct alternative to @babel/preset-react but offers additional functionality for a specific development workflow.
Babel preset for all React plugins.
See our website @babel/preset-react for more information or the issues associated with this package.
Using npm:
npm install --save-dev @babel/preset-react
or using yarn:
yarn add @babel/preset-react --dev
v7.26.3 (2024-12-04)
babel-generator
babel-helper-builder-binary-assignment-operator-visitor
, babel-plugin-transform-exponentiation-operator
babel-generator
babel-traverse
babel-plugin-transform-modules-commonjs
simplifyAccess
(@liuxingbaoyu)FAQs
Babel preset for all React plugins.
The npm package @babel/preset-react receives a total of 11,358,113 weekly downloads. As such, @babel/preset-react popularity was classified as popular.
We found that @babel/preset-react 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
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.