
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
compose-component
Advanced tools
A utility function for composing React components with children function. Inspired by redux `compose` / lodash `flowRight`.
A utility function for composing React components with children function. Inspired by redux compose / lodash flowRight.
$ npm i --save compose-component
The following code will render A1,A2-B1,B2
import React from 'react';
import ReactDOM from 'react-dom';
import compose from 'compose-component';
const A = ({ children }) => <div>{children('A1', 'A2')}</div>;
const B = ({ children }) => <div>{children('B1', 'B2')}</div>;
const AB = compose(A, B);
// <AB>
// {
// (A, B) => <div>{`${A}-${B}`}</div>
// }
// </AB>
//
// is equivalent to
//
// <A>
// {(...A) => (
// <B>
// {
// (...B) => <div>{`${A}-${B}`}</div>
// }
// </B>
// )}
// <A>
ReactDOM.render(
<AB>
{(a1Args, [ b1, b2 ] /* destructured B args */) =>
<span>{`${a1Args.join()}-${b1},${b2}`}</span>
}
</AB>,
document.querySelector('#app')
);
compose(...Components: Array<ReactClass | ReactStatelessFunction>)
Returns: ReactClass with a children function, the parameters of which consist of arrays from each Component's children function parameter
MIT
FAQs
A utility function for composing React components with children function. Inspired by redux `compose` / lodash `flowRight`.
The npm package compose-component receives a total of 1 weekly downloads. As such, compose-component popularity was classified as not popular.
We found that compose-component 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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.