
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
react-scrap
Advanced tools
A utility for quickly creating hassle-free React components with class names managed by the [JedWatson/ClassNames](https://github.com/JedWatson/classnames) module.
A utility for quickly creating hassle-free React components with class names managed by the JedWatson/ClassNames module.
npm install react-scrap
scrap(BaseComponent="div" [, ...staticNames, dynamicNamesFn])
Takes a base component, any number of static class names as strings or objects, and an optional dynamic class name render function that receives props and returns any number of dynamic class names.
import React from "react";
import ReactDOM from "react-dom";
import scrap from "react-scrap";
const Button = scrap("button", "btn", ({type="default", disabled}) => [
`btn-${props.type}`,
{"btn-disabled": disabled}
]);
const PirateButton = scrap(Button, "pirate");
function App() {
return (
<div>
<Button type="primary" disabled>
Press Me
<Button>
<PirateButton type="danger">
YARR!
</PirateButton>
</div>
);
}
ReactDOM.render(<App/>, document.querySelector("#app-container"));
renders into:
<div>
<button class="btn btn-primary btn-disabled" disabled>
Press Me
<button>
<button class="btn btn-danger pirate">
YARR!
</button>
</div>
FAQs
A utility for quickly creating hassle-free React components with class names managed by the [JedWatson/ClassNames](https://github.com/JedWatson/classnames) module.
We found that react-scrap 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
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.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.