export default class extends PureComponent {
...
render() {
const { size = 24, content, mode, color = 'rgb(97, 144, 232)', height = '160px' } = this.props
return (
<div className="loading" style={{ minHeight: height, height }}>
<div className="inner">
<div className="icon" style={{ width: `${size}px`, height: `${size}px` }}>
<Iconfont size={size} color={color} type="loading" />
</div>
{content && <div className="content">{content}</div>}
</div>
</div>
)
}
}
Set the defaultProps with ES6 destructuring. If the way is incorrect, why? Does it has any side effect?