Parallel Route not working
Answered
Somebody posted this in #help-forum
SomebodyOP
I have this layout:
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
My goal is to have an (optional) header for each route within the
Next.js 13.4.3
// /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.
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.
1 Reply
SomebodyOP
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.
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