title: React Typescript: Property 'history' does not exist on type 'PropsInterface'
body: <p>I am trying to redirect if a call to the database fails by using <code>props.history.push('/');</code> but i get the error <code>Property 'history' does not exist on type 'PropsInterface'</code> to confuse things further I am already passing in props from the parent and have them defined in <code>PropsInterface</code> how can I extend this interface to allow history</p>
  
  <pre><code>import React, { useContext, useEffect } from 'react';
  import { RouteProps } from 'react-router';
  import { RouteComponentProps } from 'react-router-dom';
  import { Global } from '../globalState';
  import { Dispatch, SET_SHARED } from '../globalState';
  
  
  interface PropsInterface {
    location: RouteProps['location'];
    children: RouteProps['children'];
  }
  
  const Layout: React.FC&lt;PropsInterface&gt; = (props: PropsInterface) =&gt; {
    const { global } = useContext(Global);
    const { dispatch } = useContext(Dispatch);
  
    useEffect(() =&gt; {
      const callApi = async (path: string) =&gt; {
  ...
          if (response.status === 200) {
            localStorage.setItem('jwtToken', content.jwtToken);
            dispatch({ type: SET_SHARED, value: content.shared });
          } else {
            localStorage.clear();
            props.history.push('/');
  //                ^
  //                 Property 'history' does not exist on type 'PropsInterface'.ts(2339)
          }
        }
      };
  </code></pre>