classname-hoc

0.2.0 • Public • Published

classname-hoc

Installing

$ npm install --save classname-hoc

Using

classNameHOC is a function which takes one or more class names as an input and returns a component class as an output. This component class will add the given class names to any children it renders.

import classNameHOC from 'classname-hoc';
 
const Rounded = classNameHOC('border-radius-10');
 
const element = (
    <Rounded>
        <div className="panel" />
    </Rounded>
);
 
// When rendered, the div will have a className prop of "panel border-radius-10"

Uses classNames under the hood so it can take the same arguments.

Package Sidebar

Install

npm i classname-hoc

Weekly Downloads

0

Version

0.2.0

License

MIT

Unpacked Size

3.47 kB

Total Files

4

Last publish

Collaborators

  • j-