title: How do i pass a function with props.history(path, state) in react router v4
body: <p>i am facing problem on my react project, what I am doing, I pushing the route through <code>props.history</code> which contain two params <code>(path, State)</code>, on state passing object which contain some keys and function. when i add a function in state object it's give me error. can somebody help me to get out of this issue.</p>
  
  <p>Here is my code.</p>
  
  <pre><code>const { history } = this.props;
          const data= {
             index: this.props.index,
             detail: this.props.object,
             handleSubmit: () =&gt; { console.log("i am not passing :(");}
          }
          history.push('/update-task/${index}', data);
  </code></pre>
  
  <p>here is screenshot of error: <a href="https://i.stack.imgur.com/E4WHA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/E4WHA.png" alt="enter image description here"></a></p>
  
  <p><strong>NOTE:</strong> when i just pass simple object and string value then it's working fine and i get the value like <code>props.location.state.key</code></p>
  
  <p>above code was working on react-router v3 but in react-router-dom not working.</p>