1
0
Fork 0
mirror of https://github.com/kou029w/_.git synced 2025-01-31 06:18:07 +00:00
_/next/pages/query/[path].tsx

15 lines
406 B
TypeScript
Raw Permalink Normal View History

2020-03-10 17:26:17 +09:00
import { useRouter } from "next/router";
export function getStaticPaths() {
2020-06-11 21:59:57 +09:00
return { paths: [{ params: { path: "test" } }], fallback: false };
2020-03-10 17:26:17 +09:00
}
export function getStaticProps({ params }: { params: unknown }) {
return { props: params };
}
2020-06-11 20:59:34 +09:00
export default function ({ path }: { path: string }) {
2020-03-10 17:26:17 +09:00
const { query } = useRouter();
return <pre>{JSON.stringify({ path, ...query }, null, " ")}</pre>;
}