Noob question: NextJS DI to avoid prop drilling?

I'm working on a project were we have a lot of props being drilled >A >B >C >D ..... I We use a lot of data or traffic getting a new page because we call the same api or get the same data to build or pages. We use 6 Contexts with their own data being fetched and handled down to the pages, components etc. Is there a better way to do this? what am I missing? Angular have these services etc. u just inject into ur component like this xx[service, service2]
5 Replies
Neto
Neto•2y ago
next does not avoid that if the context is more async, you can check react query if is more sync, check jotai or zustand
Pandaman
PandamanOP•2y ago
Thanks, I'll looking into it. I Was afraid of that 🙂
Neto
Neto•2y ago
next is more for routing, and data handling not too much into react internals
Pandaman
PandamanOP•2y ago
Just to be clear, is there anyway in react/next to avoid prop drilling or dependencies?
Neto
Neto•2y ago
next, no remix kinda does
Want results from more Discord servers?
Add your server