title: React. how to pass props from onClick to function
body: <p>I am new to React, I am trying to create an app in which I can click on a button and a function will run countdown timer, but If I pass props from onClick to begin function like this, onClick={begin(props.subject)} the function will run before I click. and if I use onClick with begin without argument, there is no props being passed down. how can I fix that? thanks </p>
  
  <pre><code>import React from 'react';
  import SubjectForm from './SubjectForm';
  
  const EditSubject=(props)=&gt;{
      return(
          &lt;div&gt;
          &lt;button onClick={begin}&gt;start&lt;/button&gt;
          &lt;/div&gt;)
  };
  
  const begin = (props)=&gt; {
     console.log(props.subject)
  }
  
  const mapStateToProps=()=&gt;{};
  
  export default connect(mapStateToProps)(EditSubject);
  </code></pre>
  
  <p>also, is there a way or trick to use a variable inside of begin function from an outside function? so I can make a pause button to pause seInterval in begin function.</p>