classnames
Advanced tools
Comparing version 2.2.0 to 2.2.1
@@ -42,3 +42,3 @@ /*! | ||
// register as 'classnames', consistent with npm package name | ||
define('classnames', function () { | ||
define('classnames', [], function () { | ||
return classNames; | ||
@@ -45,0 +45,0 @@ }); |
{ | ||
"name": "classnames", | ||
"version": "2.2.0", | ||
"version": "2.2.1", | ||
"description": "A simple utility for conditionally joining classNames together", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -73,5 +73,5 @@ /*! | ||
_parseArray(classSet, arguments); | ||
var list = []; | ||
for (var k in classSet) { | ||
@@ -93,3 +93,3 @@ if (hasOwn.call(classSet, k) && classSet[k]) { | ||
// register as 'classnames', consistent with npm package name | ||
define('classnames', function () { | ||
define('classnames', [], function () { | ||
return classNames; | ||
@@ -96,0 +96,0 @@ }); |
# Changelog | ||
## v2.2.1 / 2015-11-26 | ||
* Add deps parameter to the AMD module, fixes an issue using the Dojo loader, thanks [Chris Jordan](https://github.com/flipperkid) | ||
## v2.2.0 / 2015-10-18 | ||
@@ -4,0 +8,0 @@ |
@@ -42,3 +42,3 @@ /*! | ||
// register as 'classnames', consistent with npm package name | ||
define('classnames', function () { | ||
define('classnames', [], function () { | ||
return classNames; | ||
@@ -45,0 +45,0 @@ }); |
{ | ||
"name": "classnames", | ||
"version": "2.2.0", | ||
"version": "2.2.1", | ||
"description": "A simple utility for conditionally joining classNames together", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -70,3 +70,3 @@ Classnames | ||
if (this.state.isPressed) btnClass += ' btn-pressed'; | ||
else if (this.state.isHovered) buttonClass += ' btn-over'; | ||
else if (this.state.isHovered) btnClass += ' btn-over'; | ||
return <button className={btnClass}>{this.props.label}</button>; | ||
@@ -141,3 +141,28 @@ } | ||
Real-world example: | ||
```js | ||
/* components/submit-button.js */ | ||
import { Component } from 'react'; | ||
import classNames from 'classnames/bind'; | ||
import styles from './submit-button.css'; | ||
let cx = classNames.bind(styles); | ||
export default class SubmitButton extends Component { | ||
render () { | ||
let text = this.props.store.submissionInProgress ? 'Processing...' : 'Submit'; | ||
let className = cx({ | ||
base: true, | ||
inProgress: this.props.store.submissionInProgress, | ||
error: this.props.store.errorOccurred, | ||
disabled: this.props.form.valid, | ||
}); | ||
return <button className={className}>{text}</button>; | ||
} | ||
} | ||
``` | ||
## Polyfills needed to support older browsers | ||
@@ -144,0 +169,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
26957
177