-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated redirects example for App router
- Loading branch information
1 parent
fc382a9
commit 593f35e
Showing
7 changed files
with
52 additions
and
34 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
2 changes: 1 addition & 1 deletion
2
examples/redirects/components/Code.tsx → examples/redirects/app/_components/Code.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
2 changes: 1 addition & 1 deletion
2
examples/redirects/pages/about.tsx → examples/redirects/app/about/page.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
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 @@ | ||
export const metadata = { | ||
title: 'Next.js', | ||
description: 'Generated by Next.js', | ||
} | ||
|
||
export default function RootLayout({ | ||
children, | ||
}: { | ||
children: React.ReactNode | ||
}) { | ||
return ( | ||
<html lang="en"> | ||
<body>{children}</body> | ||
</html> | ||
) | ||
} |
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,27 @@ | ||
"use client" | ||
import { usePathname } from "next/navigation"; | ||
import Link from "next/link"; | ||
import styles from "../../../styles.module.css"; | ||
import Code from "../../_components/Code"; | ||
|
||
export default function News({ params }: Params) { | ||
const pathname = usePathname() | ||
return ( | ||
<div className={styles.container}> | ||
<div className={styles.card}> | ||
<h1>Path: {pathname}</h1> | ||
<hr className={styles.hr} /> | ||
<p> | ||
The query <Code>slug</Code> for this page is:{" "} | ||
<Code>{JSON.stringify(params.slug)}</Code> | ||
</p> | ||
<Link href="/">← Back home</Link> | ||
</div> | ||
</div> | ||
); | ||
} | ||
type Params = { | ||
params: { | ||
slug: string; | ||
}; | ||
}; |
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 was deleted.
Oops, something went wrong.