1.0.0 • Published 8 years ago
classnames-undefined v1.0.0
classnames-undefined
Wrap the classnames package for better behavior for react16
Install
npm install --save classnames-undefinedor
yarn add classnames-undefinedUsage
Please refer to document of classnames , and we extend it with this behavior: when the return value of classnames is empty string, we turned it into undefined. This can help you to output better HTML when there is no classname for the elements.
const cn = require('classnames')
console.log(cn()) // will output empty string
const cu = require('classnames-undefined')
console.log(cu()) // will output undefined1.0.0
8 years ago