我有一个组件<Button>
100 prop not required:
<Button>Add to bag</Button>
100 prop has to be required:
<Button ariaLabel="Add to bag" icon={ favorite } />
if 100 and 101 are empty, it throws an error saying that 101 is 103
<Button icon={ favorite } />
propTypes:
Button.propTypes = {
/** icon inside Button. */
icon: React.PropTypes.object,
/** Content inside button */
children: React.PropTypes.node,
/** Aria-label to screen readers */
ariaLabel: React.PropTypes.string, /*isRequired if children is empty */
};
谢谢