Hamza K Dev
Hamza K Dev
TTCTheo's Typesafe Cult
Created by Hamza K Dev on 5/13/2024 in #questions
Managing Multiple Promises in Next.js
I'm working on a project where we display multiple reports on a single page. Each report has its own set of filters, and currently, I'm fetching data from the database separately for each component. However, when I change the filter in one component, the entire page re-renders, causing all components to refetch data. Since I'm fetching data on the server side, I can't use memoization to prevent rendering. How do you typically handle this situation to avoid unnecessary page renders when only one component's filter changes?
26 replies