An utility function for writing simple prefixed classnames.
It is just a wrapper around classnames so you can use every feature from that library.
npm install @enrise/bemclassnames
The following component:
import React from "react";
import bemClassNames from "@enrise/bemclassnames";
const cn = bemClassNames("Main");
const Main = () => (
<div classnames={cn()}>
<h1 classNames={cn("title")}>The title</h1>
<div classNames={cn("content")}>The content</div>
</div>
);
export default Main;
Will result in:
<div class="Main">
<h1 class="Main-title">The title</h1>
<div class="Main-content">The content</div>
</div>