React props - set isRequired on a prop if another prop is null / empty : <p>I have a component <code>&lt;Button&gt;</code>.<br>
If the component doesn't has <code>this.props.children</code>, I want to set the prop <code>ariaLabel</code> as <code>isRequired</code>, otherwise in can be optional. How do I do that?</p>

<p><strong><code>ariaLabel</code> prop not required:</strong></p>

<pre><code>&lt;Button&gt;Add to bag&lt;/Button&gt;
</code></pre>

<hr>

<p><strong><code>ariaLabel</code> prop has to be required:</strong></p>

<pre><code>&lt;Button ariaLabel="Add to bag" icon={ favorite } /&gt;
</code></pre>

<hr>

<p><strong>if <code>this.props.children</code> and <code>this.props.ariaLabel</code> are empty, it throws an error saying that <code>this.props.ariaLabel</code> is <code>isRequired</code></strong></p>

<pre><code>&lt;Button icon={ favorite } /&gt;
</code></pre>

<hr>

<p><strong> propTypes:</strong></p>

<pre><code>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 */
};
</code></pre>

<p>Thanks</p>
