UNPKG

react-redux-express

Version:

React fullstack generator with express,redux, and some components.

27 lines (25 loc) 764 B
import RcRadio from 'rc-radio'; import React from 'react'; import classNames from 'classnames'; import { pureRender } from '../../utils'; @pureRender export default class Radio extends React.Component { static defaultProps = { prefixCls: 'shield-radio', } render() { const { prefixCls, children, checked, disabled, className, style } = this.props; const classString = classNames({ [`${prefixCls}`]: true, [`${prefixCls}-checked`]: checked, [`${prefixCls}-disabled`]: disabled, [className]: !!className, }); return ( <label className={classString} style={style}> <RcRadio {...this.props} style={null} children={null} /> {children ? <span>{children}</span> : null} </label> ); } }