title: React: How do I send a prop to a click function in ES6?
body: <p>I'm learning React and am having trouble sending props to a click function. I'm trying to create a simple ES6 counter component that increments when a button is clicked.</p>
  
  <p>My click function is simply:</p>
  
  <pre><code>click() {
     this.setState({
          count: this.state.count + value
      })
  }
  </code></pre>
  
  <p>I have set defaultProps as such:</p>
  
  <pre><code>Counter.defaultProps = { valueOne: 1 }
  </code></pre>
  
  <p>And have created my button, within the render function:</p>
  
  <pre><code>&lt;Button className="btn" clickHandler={this.click} text="Click me" value={this.props.valueOne}/&gt;
  </code></pre>
  
  <p>But I can't figure out who to get the button to 'send' the click function the value on click. I just get the message <code>value is not defined</code>.</p>
  
  <p>Would anyone be able to point me in the right direction here? </p>
  
  <p>Any help is appreciated.</p>
  
  <p>My full code is:</p>
  
  <pre><code>       class Counter extends React.Component {
  
              constructor(props) {
                  super(props);
                  this.state = { count: 0 };
                  this.click = this.click.bind(this);
              }
  
              click() {
                  this.setState({
                      count: this.state.count + value
                  })
              }
  
              render() {
                  return (
                      &lt;div className="container"&gt;
                        &lt;h1&gt;Count {this.state.count}&lt;/h1&gt;
                          &lt;Button className="btn blue-btn" clickHandler={this.click} text="Click me" value={this.props.valueOne}/&gt;
                      &lt;/div&gt;
                  )
              }
  
          }
  
          Counter.defaultProps = { valueOne: 1 } //Defaults
  
          const Button = (props) =&gt; {
              return (
                  &lt;button className={props.className} onClick={props.clickHandler} value={props.value}&gt;{props.text}&lt;/button&gt;
              )
          }
  
          ReactDOM.render(
              &lt;Counter valueOne={1} valueTwo={10} valueThree={100} /&gt;, 
              document.getElementById('app')
          );
  </code></pre>