title: How to pass useState value to getServerSideProps in Nextjs?
body: <p>Hi guys so I have been on this for 4 hrs trying to filter a product.
  I have setState upon onClick event.
  I can think of or find info on changing the query. THis is my code:</p>
  <pre><code>export async function getServerSideProps() {
      await db.connect();
      const products = await Product.find({}).lean();
      const categories = await Category.find({}).lean();
      await db.disconnect();
      return {
          props: {
              products: products.map(db.convertDocToObj),
              categories: categories.map(db.convertDocToObj),
          },
      };
  }
  </code></pre>
  <p>I have passing the state value but nothing. I think it is to provide an variable for the state and slap it in where 'meat' is, but should i dont know if i am to make serverside request that way</p>
  <pre><code>const products = await Product.find({ category: 'meat' }).lean();
  </code></pre>