Skip to main content
InterviewHubPRO
Section Overview
Q21

Question 21 of 50

Part 2: Core Architecture & Implementation (Mid-Level)

42%
Next.js & App Router (50 Qs)•Part 2: Core Architecture & Implementation (Mid-Level)

Parallel Routes (`@slot`) and Conditional Modals.

senior LevelCode ExampleSystem Design

In Simple Words: Parallel routes allow you to render one or more pages simultaneously within the same layout using named slots:

  • Directory: app/@analytics/page.tsx and app/@team/page.tsx.
  • Layout accepts slots as props:
    tsx
    export default function Layout({ children, analytics, team }: {
      children: React.ReactNode;
      analytics: React.ReactNode;
      team: React.ReactNode;
    }) {
      return (
        <div>
          {children}
          <div className="grid">{analytics}{team}</div>
        </div>
      );
    }