-
-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(create-pages): Ensure dynamic layouts receive path prop (#1256)
The logic seemed to be reversed when checking if the current layout segment is dynamic or static (see `!` in create-pages.ts), so the `path` prop was never provided. Didn't run the E2E tests locally but verified by adding a temp test to `create-pages.test.ts` locally.
- Loading branch information
Showing
4 changed files
with
40 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
e2e/fixtures/create-pages/src/components/DynamicLayout.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import type { ReactNode } from 'react'; | ||
|
||
export default function DynamicLayout({ | ||
children, | ||
path, | ||
}: { | ||
children: ReactNode; | ||
path: string; | ||
}) { | ||
return ( | ||
<> | ||
<nav>Current path: {path}</nav> | ||
{children} | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters