(cross-posted from https://github.com/orgs/vercel/discussions/7151)
When doing router.push() inside a parallel route, all n parallel routes render n times.
Say there are 5 parallel routes. Ideally, when a new route is pushed, each parallel route should have been rendered only once. (see first image)
However, that is not what happens. Here is an example with 4 parallel routes. Each parallel route renders 4 times in total. (see second image)
And here is an example with 5 parllel routes. Each parallel route renders 5 times in total. (see third image)
Reproduction repo can be found here
https://github.com/revosw/nextparallelrepro
Steps to Reproduce:
- Clone repository
- Install dependencies
- Start development server and keep the server console open
- Press one of the "push route" buttons
- Notice how the server console (not the browser console) prints getA, getB, getC, getD and getE five times in succession. I have set getE to have a 5 second timeout.