
Research
/Security News
10 npm Typosquatted Packages Deploy Multi-Stage Credential Harvester
Socket researchers found 10 typosquatted npm packages that auto-run on install, show fake CAPTCHAs, fingerprint by IP, and deploy a credential stealer.
@digitalentities/react-hook-bem
Advanced tools
withBEM() implements the BEM methodology for React in the form of a higher-order component.
Use your favourite manager to install the package:
yarn add react-with-bem
npm install react-with-bem --save
// BEM-enabled intrinsic elements are prefixed with $
import { $div, $main, Styles } from "react-with-bem";
// import styles as module (https://github.com/css-modules/css-modules)
import styles from "./App.module.scss";
// render
return (
// inject styles
<Styles value={styles}>
// set BEM block by using $block
// output: <main class="app">
<$main $block="app">
// set a BEM element by using $element
// output: <div class="app__container">
<$div $element="container">
// set BEM modifier by using $modifier (multiple modifiers are possible)
// output:
// <div class="app__container__click> when clicked === false
// <div class="app__container__click app__container__click--hidden"> when clicked === true
<$div
$element="click"
$modifier={{
hidden: clicked,
}}
>
Hello world!
</$div>
</$div>
</$main>
</Styles>
);
.app {
background-color: red;
&__container {
margin: 0 auto;
&__click {
/*! keep - so scss compiles empty class */
&--hidden {
display: none;
}
}
}
}
You can wrap your own components with the provided withBEM higher-order component:
import { YourComponent } from "./YourComponent";
import { withBEM } from "react-with-bem";
export const $YourComponent = withBEM(YourComponent);
You can find a complete example here.
FAQs
BEM for React
We found that @digitalentities/react-hook-bem 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
Socket researchers found 10 typosquatted npm packages that auto-run on install, show fake CAPTCHAs, fingerprint by IP, and deploy a credential stealer.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.