title: How to use react-router useHistory hook with TypeScript
body: <p>In my func component I am trying to use <code>history.push</code> in this way:</p>
  <pre><code>import React, { useEffect } from 'react';
  import { useHistory } from 'react-router-dom';
  
  interface Props {
    question: Question;
    selectedAnswer: SelectedOption | undefined;
  }
  
  const LastScreen: React.FC&lt;Props&gt; = (props: Props) =&gt; {
    const history = useHistory();
    ...
    
    useEffect(() =&gt; {
      if (progress === 100) {
        const id = uuid();
        history.push({
          pathname: `/p/${id}`,
          state: { userAnswers },
        });
      }
    }, [progress, userAnswers, history]);
    ...
  };
  </code></pre>
  <p>but it gives an error:</p>
  <p><code>Argument of type '{ pathname: string; state: { userAnswers: UserAnswers | undefined; }; }' is not assignable to parameter of type 'To'. Object literal may only specify known properties, and 'state' does not exist in type 'PartialPath'.ts(2345)</code></p>
  <p>How to fix it?</p>