After reading the official documentation, I still didn’t understand Next.js intercepting routes.
Given:
My questions:
- When we navigate to /photo/id1, do both page.js files get rendered?
- When we navigate to /feed/photo/id1, do both page.js files get rendered?
- Do both files get rendered if we don’t use a parallel route?
- Will we ever need to intercept routes without using parallel routes?
- Why can’t we just conditionally render the modal within /photo/[id]/page.js, using URL ‘? parameters’ and importing a template perhaps?
- Are we supposed to specify the layout of both page.js files in layout.js?