Theo's Typesafe CultTTC
Theo's Typesafe Cult16mo ago
1 reply
Mugetsu

nextjs refresh, trpc invalidate order

Does anyone know if order does matter and has any implication in case of trpc invalidation and router.refresh ?

await apiUtils.invalidate();
router.push('/location');
router.refresh();

vs
router.push('/location');
router.refresh();
await apiUtils.invalidate();


From what I see in the network tab:

1st case network calls:
1. trpc.query
2. rsc fetch
3. rsc fetch
4. layout fetch
5. page fetch

2nd case network calls:
1. rsc fetch
2. trpc.query
3. rsc fetch
4. layout fetch
5. page fetch
Was this page helpful?