
Research
/Security News
Bitwarden CLI Compromised in Ongoing Checkmarx Supply Chain Campaign
Bitwarden CLI 2026.4.0 was compromised in the Checkmarx supply chain campaign after attackers abused a GitHub Action in Bitwarden’s CI/CD pipeline.
babel-react-defaultprops
Advanced tools
A babel plugin that extracts es6 default parameters and append it to the component property named __defaultProps.
npm install --save-dev babel-react-defaultprops
yarn add -D babel-react-defaultprops
Add the plugin to the Babel configuration:
babel.config.js
module.exports = {
plugins: ['module:babel-react-defaultprops'],
};
Before:
export function FunctionComponent({ bar, foo = 'func' }) {
return <div>{bar + foo}</div>;
}
After:
function FunctionComponent(_ref) {
var bar = _ref.bar,
_ref$foo = _ref.foo,
foo = _ref$foo === void 0 ? 'func' : _ref$foo;
return _react['default'].createElement('div', null, bar + foo);
}
FunctionComponent.__defaultProps = {
foo: 'func',
};
Or with defaults in function body:
Before:
export const VariableComponent = (props) => {
const { bar, foo = 'variable' } = props;
return <div>{bar + foo}</div>;
};
After:
var VariableComponent = function VariableComponent(props) {
var bar = props.bar,
_props$foo2 = props.foo,
foo = _props$foo2 === void 0 ? 'variable' : _props$foo2;
return _react['default'].createElement('div', null, bar + foo);
};
VariableComponent.__defaultProps = {
foo: 'variable',
};
For more example look into the test folder.
If using typescript ad following to theglobal.d.ts file:
declare module 'react' {
export interface FunctionComponent<P = unknown> {
__defaultProps?: Partial<P>;
}
}
export {};
Node that the default props with the locale variable as a value in the function body will not be included.
FAQs
A plugin to extract es6 default parameters
The npm package babel-react-defaultprops receives a total of 6 weekly downloads. As such, babel-react-defaultprops popularity was classified as not popular.
We found that babel-react-defaultprops demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.

Research
/Security News
Bitwarden CLI 2026.4.0 was compromised in the Checkmarx supply chain campaign after attackers abused a GitHub Action in Bitwarden’s CI/CD pipeline.

Research
/Security News
Docker and Socket have uncovered malicious Checkmarx KICS images and suspicious code extension releases in a broader supply chain compromise.

Product
Stay on top of alert changes with filtered subscriptions, batched summaries, and notification routing built for triage.