React

[classnames] 다양한 활용 방법, 1개인 경우에도 cx()로 통일? tabnine 참고

Asset Type
File Type
When to use
Reference
Created by
Created time
2022/03/13 14:48
Last edited time
2022/03/13 16:00
let cn = classNames.bind(styles); let deleteButton = cn('btn btn-sm btn-primary'); let deleteButtonIcon = cn('fa', { 'fa-trash': !this.props.deleting, 'fa-spinner': this.props.deleting, 'fa-spin': this.props.deleting }); return ( <button bs-button className={deleteButton} onClick={this.deleteRoute} disabled={this.state.deleting} > <i className={deleteButtonIcon} aria-hidden="true"></i> </button> );
TypeScript
복사

cx