-
Notifications
You must be signed in to change notification settings - Fork 27.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix not found css not being preloaded while navigation
- Loading branch information
Showing
9 changed files
with
104 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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,5 @@ | ||
import { notFound } from 'next/navigation' | ||
|
||
export default function page() { | ||
notFound() | ||
} |
12 changes: 12 additions & 0 deletions
12
test/e2e/app-dir/app-css/app/navigate/button/not-found-button.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 styles from './not-found-button.module.css' | ||
import React from 'react' | ||
|
||
export const Button = ({ children, ...props }) => { | ||
return ( | ||
<button {...props} className={styles.button}> | ||
{children} | ||
</button> | ||
) | ||
} |
7 changes: 7 additions & 0 deletions
7
test/e2e/app-dir/app-css/app/navigate/button/not-found-button.module.css
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 @@ | ||
.button { | ||
border: 1px solid #ccc; | ||
border-radius: 4px; | ||
background: rgb(0, 128, 0); | ||
color: #fff; | ||
padding: 8px 16px; | ||
} |
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,22 @@ | ||
'use client' | ||
import { Button } from './button/not-found-button' | ||
import { useRouter } from 'next/navigation' | ||
|
||
function NotFound() { | ||
const router = useRouter() | ||
return ( | ||
<div> | ||
<h1>404 - Page Not Found</h1> | ||
<Button | ||
id="back" | ||
onClick={() => { | ||
router.push('/navigate') | ||
}} | ||
> | ||
Back | ||
</Button> | ||
</div> | ||
) | ||
} | ||
|
||
export default NotFound |
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,20 @@ | ||
'use client' | ||
|
||
import { useRouter } from 'next/navigation' | ||
import { Button as NotFoundButton } from './button/not-found-button' | ||
|
||
export default function Page() { | ||
const router = useRouter() | ||
return ( | ||
<> | ||
<NotFoundButton | ||
id="nav-button" | ||
onClick={() => { | ||
router.push('/navigate/404') | ||
}} | ||
> | ||
Not Found | ||
</NotFoundButton> | ||
</> | ||
) | ||
} |
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