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•17mo 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
Pandaman•17mo ago
Thanks, I'll looking into it. I Was afraid of that 🙂
Neto
Neto•17mo ago
next is more for routing, and data handling not too much into react internals
Pandaman
Pandaman•17mo ago
Just to be clear, is there anyway in react/next to avoid prop drilling or dependencies?
Neto
Neto•17mo ago
next, no remix kinda does
Want results from more Discord servers?
Add your server