A decorator to create add a convenient classNames prop.
npm start dev
then visit http://127.0.0.1:3000
import classNames from 'react-classnames';
@classNames
export default class Demo extends React.Component {
render() {
return (
<div>
<div classNames='Demo'/>
<div classNames={ ['main', false && 'hidden', true && 'visible'] } className='other-class'/>
</div>
);
}
};
Use the factory to customize :
import { factory } from 'react-classtree';
const classes = factory({ propName: 'classes' });