title: Multiplication of a number by 10 by automatically calculating in State - React JS
body: <p>In this example I want user to increase or decrease the numbers in input box and the number multiplied by 10 should be seen in the span adjescant to input box.  I am not able to fetch the result. Can someone help me out. </p>
  
  <p><strong>Snippet:</strong></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="true">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>class App extends React.Component {
    state = {
      initialValue: 0,
      finalValue: initialValue* 10
    }
    render() {
  
      return (
      &lt;div&gt;
          &lt;input type="number" value={this.state.initialValue} onChange={this.alpha} name="initialValue" id="initialValue"/&gt;
          &lt;span&gt;{this.state.finalValue}&lt;/span&gt;
      &lt;/div&gt;
     )
    }
     alpha = (ev) =&gt; {
      this.setState({
              [ev.target.name]: ev.target.value
      });
     }
  
  }
  ReactDOM.render(&lt;App/&gt;, document.getElementById('app'));</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react.js"&gt;&lt;/script&gt;
  &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react-dom.js"&gt;&lt;/script&gt;
  &lt;div id="app"&gt;&lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>