title: NextJS: data fetching in child component and pass to parent component
body: <p>I am new to Next.js and trying to make an e-commerce project. I am stuck on if a child component <strong>Sort</strong> Component has a post request to the server to filter the data and pass it back to the <strong>Products</strong> component as product props.</p>
  <blockquote>
  <p>The folder structure is like this:</p>
  </blockquote>
  <pre><code>&lt;&gt;
   &lt;Sort /&gt;
   &lt;Products products={products} /&gt;
  &lt;/&gt;
  </code></pre>
  <p>Inside the <strong>Sort</strong> component, I will send the filter parameters back to the server. So the method I am thinking of is using Redux, but can I use the <code>useSWR</code> hook? As the action is taken at <strong>Sort</strong> component, seems <code>useSWR</code> hook need to have the action and the data returned together in the same component, is that correct?</p>