#njs13.3 parallel/intercepting route file duplication?

7 messages · Page 1 of 1 (latest)

tropic glacier
#

in this example on intercepting/parallel routs

[feed]
├── (..)photo/[id]
│   └── page.tsx
└── layout.tsx
photo/[id]
├── page.tsx
└── layout.tsx

in the (..)photo/[id] directory as well as the root photo/[id] directory there are is a page.tsx. does this mean we need to duplicate the file? so the same file exists in two places?

heavy saffron
#

I think you can import from the other so you don't need to duplicate code, just the structure (route)

tropic glacier
#

ok yea thats the direction i was trying. although its just navigating me to that page without popping up a modal 🤷‍♂️

heavy saffron
#

yea I think it's not working at all, or the docs are wrong

#

waiting for examples

heavy saffron
#

Look at test/e2e/app-dir/parallel-routes-and-interception/app/intercepting-parallel-modal, it has some good examples.

#

If you're getting 404 in nested routes, you need default.tsx for your @page