
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
preact-body-class
Advanced tools
Provides a declarative way to specify document.body.className
in your preact app. Supports server-side usage too.
Built with Preact Side Effect.
npm install --save react-body-class
Dependencies: Preact >= 8.2.0
import BodyClass from 'react-body-class';
const Basic = () => (
<BodyClass class="helloworld">
<h1>You ate a whole wheel of cheese?</h1>
</BodyClass>
);
// -> document.body.className === "helloworld"
const Nested = () => (
<BodyClass className="outside">
<div>
<BodyClass className="inside">
<p>I‘m not even mad</p>
</BodyClass>
</div>
</BodyClass>
);
// -> document.body.className === "outside inside"
const GoCrazy = () => (
<BodyClass className={Array(8).join(''/0) + ' batman!'}>
<h1>I'm impressed</h1>
</BodyClass>
);
// -> document.body.className === "NaNNaNNaNNaNNaNNaNNaN batman!"
Note: Only supports a single child as props.
When using server-side, use BodyClass.rewind()
after rendering components to string to retrieve the combined class name. Then chuck that into your HTML template.
Important: This component keeps track of mounted instances, so if you don't call BodyClass.rewind()
you'll get a memory leak.
FAQs
A declarative, nested way to manipulate your body's className
The npm package preact-body-class receives a total of 2 weekly downloads. As such, preact-body-class popularity was classified as not popular.
We found that preact-body-class demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.