Next.js Discord

Discord Forum

Parallel Route not working

Answered
Somebody posted this in #help-forum
Open in Discord
Avatar
I have this layout:
// /app/(lists)/layout.tsx
export const ListLayout = async (props: { children: React.ReactNode; header: React.ReactNode }) => {
  return (
    <>
      <div className={css.header}>
        {props.header}
      </div>
      <div className={css.content}>
        {props.children}
      </div>
    </>
  );
};

export default ListLayout;


This is my directory structure:
- app
- layout.tsx
- (lists)
- layout.tsx
- @header
- default.tsx
- series
- page.tsx
- @header
- page.tsx

From what I understood in the parallel routes documentation, when I navigate to /series, the header prop should be available in /app/(lists)/layout.tsx, however neither the default nor the series page header are displayed.
My goal is to have an (optional) header for each route within the (lists) directory.

Next.js 13.4.3
Answered by Somebody
Solved.

The correct structure seems to be:
- app
- layout.tsx
- (lists)
- layout.tsx
- @header
- default.tsx
- series
- page.tsx
- series
- page.tsx

Also a restart of the dev server is necessary to detect the changes.
View full answer

1 Reply

Avatar
Solved.

The correct structure seems to be:
- app
- layout.tsx
- (lists)
- layout.tsx
- @header
- default.tsx
- series
- page.tsx
- series
- page.tsx

Also a restart of the dev server is necessary to detect the changes.
Answer