Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Hannes Bornö
committed
Oct 25, 2022
1 parent
28d6ee2
commit a577ff2
Showing
6 changed files
with
129 additions
and
0 deletions.
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
7 changes: 7 additions & 0 deletions
7
test/e2e/app-dir/app-static/app/hooks/use-pathname/[slug]/layout.js
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,7 @@ | ||
export default function Layout({ children }) { | ||
return children | ||
} | ||
|
||
export function generateStaticParams() { | ||
return [{ slug: 'slug' }] | ||
} |
12 changes: 12 additions & 0 deletions
12
test/e2e/app-dir/app-static/app/hooks/use-pathname/[slug]/page.js
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,12 @@ | ||
'use client' | ||
import { usePathname } from 'next/navigation' | ||
|
||
export const config = { | ||
dynamicParams: false, | ||
} | ||
|
||
export default function Page() { | ||
const pathname = usePathname() | ||
|
||
return <p id="pathname">{pathname}</p> | ||
} |
7 changes: 7 additions & 0 deletions
7
test/e2e/app-dir/app-static/app/hooks/use-search-params/[slug]/layout.js
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,7 @@ | ||
export default function Layout({ children }) { | ||
return children | ||
} | ||
|
||
export function generateStaticParams() { | ||
return [{ slug: 'slug' }] | ||
} |
19 changes: 19 additions & 0 deletions
19
test/e2e/app-dir/app-static/app/hooks/use-search-params/[slug]/page.js
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,19 @@ | ||
'use client' | ||
import { useSearchParams } from 'next/navigation' | ||
|
||
export const config = { | ||
dynamicParams: false, | ||
} | ||
|
||
export default function Page() { | ||
const params = useSearchParams() | ||
|
||
return ( | ||
<> | ||
<p id="params-first">{params.get('first') ?? 'N/A'}</p> | ||
<p id="params-second">{params.get('second') ?? 'N/A'}</p> | ||
<p id="params-third">{params.get('third') ?? 'N/A'}</p> | ||
<p id="params-not-real">{params.get('notReal') ?? 'N/A'}</p> | ||
</> | ||
) | ||
} |
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