title: React routing to anther page when load successfully
body: <p>I have a several page react website. In page A, the user clicks a button that retrieves some contents in firebase. I would like to go to page B only if the retrieval is successful and pass the retrieved content as well.</p>
  <p>Here is the router to pageB where ciphertext and plaintext are set to null unless the content is retrieved from Firebase.</p>
  <pre><code>&lt;Route path={`${path}/pageB`}&gt;
    &lt;NewContent props={[ciphertext, plaintext]}/&gt;
  &lt;/Route&gt;
  </code></pre>
  <p>Here is the &quot;next&quot; button that will lead to pageB if getStatus from firebase is successful.</p>
  <pre><code>{
      getStatus === 3 &amp;&amp;
      &lt;Link to={`${path}/pageB`} className='button'&gt; 
        Next 
      &lt;/Link&gt;
  }
  </code></pre>
  <p>Currently, there is a &quot;load&quot; button and when loaded successfully, a &quot;next&quot; button will show up to go to the next page. I would like to remove the next button and go to the second page directly when loaded to make it more intuitive. Thank you!</p>