import React from 'react'; const prefixCls = 'ant-tag'; class AntTag extends React.Component { constructor(props) { super(props); this.state = { closed: false }; } close(e) { this.setState({ closed: true }); this.props.onClose.call(this, e); } render() { let close = this.props.closable ? : ''; let colorClass = this.props.prefixCls + '-' + this.props.color; return this.state.closed ? null :
; } } AntTag.defaultProps = { prefixCls: prefixCls, closable: false, onClose: function() {} }; export default AntTag;