title: ID is gone when I refresh a NextJS Dynamic Route page
body: <p>I am trying to get dynamic routing working in order to display and retrieve the right information using the id from the url. This works when I visit the page, but when I reload the page the id is blank. Is this fixable? I couldn't find a answer for it on the internet.</p>
  <p>Any help would be appreciated.</p>
  <p>Code for reference</p>
  <pre><code>//Initializing router
  const router = useRouter();
  
  //Getting id from url
  const { id } = router.query;
  
  //Fetching postdata
    const getPostData = async () =&gt; {
      setLoading(true);
      await db
        .collection(&quot;Posts&quot;)
        .doc(id)
        .get()
        .then(function (doc) {
          if (doc.exists) {
            setPostData(doc.data());
            setLoading(false);
          } else {
            //router.push(&quot;/404&quot;);
          }
        })
        .catch(function (error) {
          //router.push(&quot;/404&quot;);
        });
    };
  </code></pre>