title: Displaying value of variable from jsx function in Reactjs
body: <p>I am very new to react and when I was trying out a simple addition function using variables, I was unable to display my output.</p>
  <pre><code>total= ()=&gt;
      {
       let a=(variable:{this.props.id})
       let b=(variable:{this.props.id})
       let c=a+b
      }
  render() { 
          return (  
  
              &lt;div&gt;
  
  
  
  Total: {this.total(this.c)}
  
              &lt;/div&gt;
          );
      }
  }
   
  export default Total;
  </code></pre>
  <p>Why is this happening ? Is there any other way to display the variables, because in my IDE (VS-Code), I am getting an error that &quot;this code is unreachable&quot;.</p>