We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
classnames is a simpler way to interact with class names in React.
classnames
Allows for using an array or dict to defined classes, can make code a lot cleaner.
/* 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>; } };
The text was updated successfully, but these errors were encountered:
No branches or pull requests
classnames
is a simpler way to interact with class names in React.Allows for using an array or dict to defined classes, can make code a lot cleaner.
The text was updated successfully, but these errors were encountered: