ant-design/components/checkbox/index.jsx
Bruce Mitchener 63c06e8652 Use ES2015 classes instead of React.createClass.
Make Breadcrumb, Checkbox, Dropdown, Steps and Timeline
components use ES2015 classes rather than React.createClass.

This includes:

* getDefaultProps method becomes a defaultProps value on the
  constructor.
* propTypes becomes a value on the constructor.
2016-03-18 09:35:15 +07:00

27 lines
667 B
JavaScript

import RcCheckbox from 'rc-checkbox';
import React from 'react';
import Group from './Group';
import classNames from 'classnames';
export default class Checkbox extends React.Component {
render() {
const { prefixCls, style, children, className, ...restProps } = this.props;
const classString = classNames({
[className]: !!className,
[`${prefixCls}-wrapper`]: true,
});
return (
<label className={classString} style={style}>
<RcCheckbox {...restProps} prefixCls={prefixCls} children={null} />
{children}
</label>
);
}
}
Checkbox.defaultProps = {
prefixCls: 'ant-checkbox'
};
Checkbox.Group = Group;