
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.
react-hoc-context
Advanced tools
Dependency-inject a module using react higher-order components (HOCs)
Wrap your component in withModule to have props.module injected into your components.
Objects in the module may persist outside the component scope.
Avoids needless piping of objects through the props of components.
You may pass in additional modules into withModule to have the lifecycle
of the given modules bound to the component.
props.module is a composite of all added modules.
Import looks like:
import withModule from "react-hoc-di/withModule";
Usage often looks like this:
export default withModule(MyScreen, MyModule);
or
export default withModule(MyComponent);
or
export default withModule(MyComponent, [MyModule1, MyModule2]);
Modules always define a construct and destruct function.
Note construct is not the same as constructor.
The shell of a module looks like this:
class MyModule {
constructor(rootModule) {
this.rootModule = rootModule;
}
construct() {
// Set objects onto root module.
}
destruct() {
// Remove those objects from root module.
}
}
export default MyModule;
Remember to npm run build before deploying.
FAQs
Dependency-inject a module using react higher-order components (HOCs)
We found that react-hoc-context 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.