title: Leading Zeroes in React form
body: <p>I'm an intermediate React developer.  I'm building a form with React, Redux, and React Number Format.  For the most part things are going well, but I'm a bit hung up on how to get rid of leading zeroes for my component.  I think I understand the problem but I'm not sure where the right place to intervene is.</p>
  
  <p>My app is deployed <a href="https://petervkay.github.io/roiCalculator/" rel="nofollow noreferrer">here</a>. Here's my code defining my number field (from customInput.js)</p>
  
  <pre><code>             &lt;NumberFormat
                 value = {this.props.input.value || 0}
                 onFocus = {()=&gt;{}}
                 onBlur = {this.handleChange.bind(this)}
                 onChange = {this.handleChange.bind(this)}
                 onInput = {this.handleChange.bind(this)}
                      thousandSeparator = {true}
                      prefix = {this.props.prefix}
                      suffix = {this.props.suffix}
                 decimalScale = {1}
                 isAllowed={(values) =&gt; {
                   const {floatValue} = values;
                   if (typeof floatValue==='undefined') {
                     return true;
                   }     
  
                   if (this.props.maximum) {
                     return floatValue &lt;= this.props.maximum;
                   } else {
                     return true;
                   }
  
                 }}
              /&gt;
  </code></pre>
  
  <p>It may be more helpful to look at my full code on <a href="https://github.com/petervkay/roiCalculator/" rel="nofollow noreferrer">GitHub</a>.</p>
  
  <p>This is my diagnosis of the problem.  My input is taking its value from props, not from state.  I found this easier when creating some of the field logic to avoid double renderings.  When a field is changed, the change is dispatched to the Redux store.  The field's state is not really used at all.  I'm not sure if this is good practice, but it has worked well for me.
  The problem is that when I dispatch a change adding a leading zero, Redux does not recognize it as a change.  For example "005" and "5" are both seen as 5.  Therefore, the component does not re-render.  I've tried a lot of different fixes, but nothing resolves this issue.
  Anyone have a recommendation?</p>