title: React - Set input number value conditionally
body: <p>I have 2 input type number fields and I'm trying to set the second field value(num2) conditionally based on the first one's(num1) value. </p>
  
  <pre><code>&lt;input ref="num1" type="number" min="1" max="7" defaultValue={6}/&gt;
  
  &lt;input ref="num2" type="number" min="0" max={this.refs.num1 === 7 ? 0 : 10} defaultValue={10}/&gt;
  </code></pre>
  
  <p>I've tried the above ternary operator to set value 0 if <code>num1</code>'s value is equal to 7. The default value for <code>num1</code> is 6 and when I stepup to 7, there is no different I can see in <code>num2</code>. </p>
  
  <p>Please help me fix this.</p>