title: How to make forwarding react router 5
body: <p>I am new to react and typescript.
  I have a component Err.
  I want to redirect it using react router 5 ?.</p>
  
  <pre><code>import React, { FC, Fragment, useEffect } from "react";
  
  const Err: FC&lt;{ error: string }&gt; = ({ error }) =&gt; {
    useEffect(()=&gt;{
     const time = setTimeout(() =&gt;  {???(`/`)}, 2000);
     return(()=&gt; clearTimeout(time));
    },[error])
    return (
      &lt;Fragment&gt;
        &lt;div&gt;{error}&lt;/div&gt;
        &lt;div&gt;{"Contact site administrator"}&lt;/div&gt;
      &lt;/Fragment&gt;
    );
  };
  </code></pre>