title: I want to pass counter value to my component using props
body: <p>I want to pass counter  value to my component using props. I do not know how i should pass counter value.  Here is my component counter.</p>
  
  <pre><code>import React, { Component } from 'react'
  
  class Counter extends Component {
      constructor(props) {
          super(props)
          this.state = {
              count: 0
          }
      }
  
      increment(props) {
          this.setState((prevState) =&gt; ({
              count: prevState.count + 1
          }))
  
          console.log(this.state.count)
      }
  
      incrementFive() {
          this.increment()
          this.increment()
          this.increment()
          this.increment()
          this.increment()
      }
  
      render() {
          return (
              &lt;div&gt;
                  &lt;div&gt; Count - {this.state.count}&lt;/div&gt;
                  &lt;button onClick={() =&gt; this.incrementFive()}&gt;Increment&lt;/button&gt;
              &lt;/div&gt;
          )
      }
  }
  
  export default Counter
  </code></pre>
  
  <p>I used my Counter component in App.js like below </p>
  
  <pre><code>&lt;Counter&gt;&lt;/Counter&gt;
  </code></pre>