title: Setting conditional onClick behaviour in React Component
body: <p>I'm working on a component where a button (input field of type 'submit') will submitting data once clicked. However, I'd like to introduce a safeguard to show an alert on screen if the input field is blank.</p>
  
  <p>Thinking this would work the same way as it would for component attributes, I've tried variations on the following without much luck:</p>
  
  <pre><code>onClick={props.inputText === '' 
                  ? 
                  alert("Text cannot be blank.") 
                  : 
                  (e =&gt; props.onSubmit(props.inputText))}/&gt;
  </code></pre>
  
  <p>I'd rather not run the check inside the <em>onSubmit</em> function in order to isolate updates to the store as far as possible (I'm following a React-Redux structure).</p>
  
  <p>Any idea if and how JSX handles a situation like this?</p>