Prop drilling and react query
Unanswered
Giant Chinchilla posted this in #help-forum
Giant ChinchillaOP
Hi everyone,
I have a question about Next.js. Can using React Query help solve the prop drilling issue, and does it mean we might not need a state management tool? If we’re working on a large project, what’s your opinion? I’m a beginner, so any guidance would be really helpful🤗
Thanks!
I have a question about Next.js. Can using React Query help solve the prop drilling issue, and does it mean we might not need a state management tool? If we’re working on a large project, what’s your opinion? I’m a beginner, so any guidance would be really helpful🤗
Thanks!
2 Replies
Giant ChinchillaOP
Any one 🤗
Miniature Pinscher
Since you're using Next, why not take advantage of server components and let that be the place of fetching? Yes, that could be a drop in replacement of some parts of a state managing library, as it dedupes the fetches across multiple components. And as for the caching part, you should leverage fetch tagging and revalidating them as needed (or setting a revalidation time period).