title: Uncaught DOMException: Failed to execute 'pushState' on 'History': function () { [native code] } could not be cloned
body: <p>I am creating a small web app in reactjs template provided by visual studio 2017. I am stuck in a situation where i want a function to be passed as a state to a child component and then invoke that function through child component. I have a header component where i have a method called <strong>setLogInTrue()</strong> which i want to pass to my SignIn component. Below is my code:-</p>
  
  <p>Header.tsx</p>
  
  <pre><code>class HeaderState {
  isLoggedIn: boolean;
  }
  
  export class Header extends React.Component&lt;HeaderProps, HeaderState&gt; {
  constructor() {
      super()
      this.state = ({ isLoggedIn: false });
      this.setLogInTrue= this.setLogInTrue.bind(this);
  }
  
  setLogInTrue() {
      this.setState({ isLoggedIn: true });
  }
  
  public render(){
  //Some elements
  &lt;NavLink className="link header_row_link" to={{ pathname: '/signIn', state: this.setLogInTrue }}&gt; //&lt;-- i thought this would work and give the function in the location of SignIn components state but it does not.
                Sign In
  &lt;/NavLink&gt;
    }
  }
  </code></pre>
  
  <p>SignIn.tsx</p>
  
  <pre><code>export class SignIn extends React.Component&lt;RouteComponentProps&lt;{}&gt;, {}&gt;  {
  
  constructor() {
      super();
  }
  
  public render() {
      return &lt;div className="signin_wrapper"&gt;
          &lt;SignInContent /&gt;
      &lt;/div&gt;;
    }
  }
  </code></pre>
  
  <p>I want to access that function here and pass it to SignInContent component, and then invoke that function from there.</p>
  
  <p>This code does not give me any compile time errors but whenever i click on the sign in link it gives me the following error</p>
  
  <blockquote>
    <p>Uncaught DOMException: Failed to execute 'pushState' on 'History': function () { [native code] } could not be cloned.</p>
  </blockquote>
  
  <p>i tried <a href="https://stackoverflow.com/questions/46800237/why-failed-to-execute-pushstate-on-history-when-using-link-from-react-ro">this</a> solution but it does not work for me. It still gives me this error or gives state as undefined. I am very new to react and any help would be appreciated</p>