title: How to "Redirect to" after 'x' seconds using react-router-dom
body: <p>I'm beginner in React Js. I would like to redirect to path '/event' after 2 seconds.</p>
  <p>This way is not working:</p>
  <pre><code>import React from 'react';
  import { getFormData } from '../../../helpers/form';
  import { eventCreate } from '../../../actions/EventActions';
  import { Redirect } from 'react-router-dom';
  import { connect } from 'react-redux';
  
  if (event) {
    setTimeout(() =&gt; {
      return &lt;Redirect to={'/event'} /&gt;;
    }, 2000);
  }
  </code></pre>
  <p>But if I change it to:</p>
  <pre><code>if (event) {
    return &lt;Redirect to={'/event'} /&gt;;
  }
  </code></pre>
  <p>It works perfectly. How could I redirect after 2 seconds?</p>