Loading video...

Video Failed to Load

Go Home

Conditional parallel routes in Next.js

108,935 views • 2 years ago •via X (Twitter)

9 Comments

henrique ↑%'s profile picture
henrique ↑%2 years ago

Amazing!! How apply this with TypeScript? The type of user and admin in props Layout?

Fredkisss is on 🦋 blue sky 🦋's profile picture
Fredkisss is on 🦋 blue sky 🦋2 years ago

You still need to make sure to add a condition role check in each parallel route because they are still executed even if only one is rendered.

Alex Sidorenko's profile picture
Alex Sidorenko2 years ago

Ah, good catch! Thanks for pointing this out. Looks like a known bug.

Qing | quotion.co's profile picture
Qing | quotion.co2 years ago

Awesome, this is also useful for conditional layout like sidebar, e.g. declare 2 sidebar routes for various scenarios(/site and /team)

moni's profile picture
moni2 years ago

what tool do you use for editing / recording these videos?

chronark — oss/acc's profile picture
chronark — oss/acc2 years ago

well that was incredibly simple to understand, kudos!

Eyk Rehbein's profile picture
Eyk Rehbein2 years ago

Okay now that’s a great advantage compared to the pages router

Umair's profile picture
Umair2 years ago

Which video editor is this?? Alex

Alex Sidorenko's profile picture
Alex Sidorenko2 years ago

@hyeumair This was a combination of Apple Keynote and @Remotion with a custom setup. I spent waaaay too much time on this 😅

Related Videos