Skip to content

Instantly share code, notes, and snippets.

@natterstefan
Created January 18, 2023 10:08
Show Gist options
  • Select an option

  • Save natterstefan/4899c33d5849c16c6c3ca34851e6848b to your computer and use it in GitHub Desktop.

Select an option

Save natterstefan/4899c33d5849c16c6c3ca34851e6848b to your computer and use it in GitHub Desktop.

Revisions

  1. natterstefan created this gist Jan 18, 2023.
    1 change: 1 addition & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    # Next.js | Catch-All route including index
    9 changes: 9 additions & 0 deletions [...params].tsx
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    import React from 'react'

    export default () => <p>Hello World</p>

    export const getServerSideProps = async () => {
    return {
    props: {},
    }
    }
    6 changes: 6 additions & 0 deletions index.tsx
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    // inspired by https://github.com/vercel/next.js/issues/10488#issuecomment-930702885
    import Page from './[...params]'

    export { getServerSideProps } from './[...params]'

    export default Page