
Security News
Security Community Slams MIT-linked Report Claiming AI Powers 80% of Ransomware
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.
@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
The npm package @digitalentities/react-hook-bem receives a total of 0 weekly downloads. As such, @digitalentities/react-hook-bem popularity was classified as not popular.
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.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.

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.