title: How do you get query params from the url in getInitialProps?
body: <p>I have a clean url that contains some query param like this.</p>
  
  <blockquote>
    <p><a href="http://localhost:3000/post/:id" rel="noreferrer">http://localhost:3000/post/:id</a></p>
  </blockquote>
  
  <p>I'm trying to capture the query parameter 'id' on the client side like this.</p>
  
  <pre><code>static async getInitialProps({req, query: { id }}) {
      return {
          postId: id
      }
  }
  
  render() {
    const props = { 
         data: {
            'id': this.props.postId        // this query param is undefined
         }
    }
    return (
       &lt;Custom {...props}&gt;A component&lt;/Custom&gt;
    )
  }
  </code></pre>
  
  <p>My express endpoint looks like this.</p>
  
  <pre><code>app.post(
      '/post/:id',
      (req, res, next) =&gt; {
          let data = req.body;
          console.log(data);
          res.send('Ok');
      }
  );
  </code></pre>
  
  <p>But my server side console output ends up like this.</p>
  
  <pre><code>{ id: 'undefined' }
  </code></pre>
  
  <p>I've read the docs and the github issues but I can't seem to understand why this is happening.</p>