0.2.0 • Published 6 years ago

classname-hoc v0.2.0

Weekly downloads
4
License
MIT
Repository
github
Last release
6 years ago

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.

0.2.0

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago