-
Notifications
You must be signed in to change notification settings - Fork 27.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
This is a reapplication of the [original fix](#75377) for optional catchall routes but narrowed to only when the parameters weren't already valid.
- Loading branch information
Showing
9 changed files
with
251 additions
and
83 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
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
29 changes: 29 additions & 0 deletions
29
...integration/required-server-files-ssr-404/pages/partial-catch-all/[domain]/[[...rest]].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,29 @@ | ||
import { useRouter } from 'next/router' | ||
|
||
export const getStaticProps = ({ params }) => { | ||
return { | ||
props: { | ||
hello: 'world', | ||
params: params || null, | ||
random: Math.random(), | ||
}, | ||
} | ||
} | ||
|
||
export const getStaticPaths = () => { | ||
return { | ||
paths: ['/partial-catch-all/hello.com'], | ||
fallback: true, | ||
} | ||
} | ||
|
||
export default function Page(props) { | ||
const router = useRouter() | ||
return ( | ||
<> | ||
<p id="catch-all">partial optional catch-all page</p> | ||
<p id="router">{JSON.stringify(router)}</p> | ||
<p id="props">{JSON.stringify(props)}</p> | ||
</> | ||
) | ||
} |
Oops, something went wrong.