Parallel routes are rendering unnecessarily, requiring conditional logic fixes.
The issue involves parallel routes rendering unnecessarily, even when conditional logic should prevent it. This affects routing behavior and requires understanding Next.js's parallel routes implementation. The problem is reproducible but lacks clear guidance on expected behavior or fixes.
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 22.5.0: Thu Jun 8 22:22:20 PDT 2023; root:xnu-8796.121.3~7/RELEASE_ARM64_T6000
Binaries:
Node: 18.16.0
npm: 9.8.1
Yarn: 1.22.19
pnpm: 8.6.10
Relevant Packages:
next: 13.4.13-canary.5
eslint-config-next: 13.4.12
react: 18.2.0
react-dom: 18.2.0
typescript: 5.1.6
Next.js Config:
output: N/A
Routing (next/router, next/navigation, next/link)
https://github.com/slvstr-dev/test-parallel
In layout.tsx I want to render conditionally render a parallel route, f.e. if a user is logged in or not. Currently it runs code from both routes. Console.log's of both page.tsx in root and page.tsx in @auth are being run.
Based on the condition I only expect the console.log from the returned page to run.
No response
No response
Claim this issue to let others know you're working on it. You'll earn 10 points when you complete it!