title: I’m trying to make a digital "receipt" using the props that are in a class and using a counter that tells me the quantity, multiply it by the price,
body: <p>I state that I am a novice with React</p>
  <p>I've tried to do so...but it doesn't work</p>
  <p>these are the constant that i've created:</p>
  <pre><code>const [Receipt,setReceipt]=useState(0);
    //here i try to take the value on another class
    const quantity = {...this.props.cards};
    const price= {...this.props.cards};
    
  </code></pre>
  <p>This is the button that should calculate the receipt</p>
  <pre><code>  return( 
  //This is the button that i use to do the Receipt
  &lt;div&gt;
        &lt;p&gt;  {Receipt} &lt;/p&gt;
        
        &lt;button onClick={() =&gt; setReceipt(this.quantity * this.prezzo)}&gt;
          Click me
        &lt;/button&gt;
      &lt;/div&gt;
  
    );
  
    
  }
  }
  </code></pre>