Skip to content

Instantly share code, notes, and snippets.

@natterstefan
Created January 18, 2023 10:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save natterstefan/4899c33d5849c16c6c3ca34851e6848b to your computer and use it in GitHub Desktop.
Save natterstefan/4899c33d5849c16c6c3ca34851e6848b to your computer and use it in GitHub Desktop.
Next.js | Catchall including index
import React from 'react'
export default () => <p>Hello World</p>
export const getServerSideProps = async () => {
return {
props: {},
}
}

Next.js | Catch-All route including index

// inspired by https://github.com/vercel/next.js/issues/10488#issuecomment-930702885
import Page from './[...params]'
export { getServerSideProps } from './[...params]'
export default Page
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment