1
0
Fork 0
mirror of https://github.com/kou029w/_.git synced 2025-01-31 14:28:04 +00:00
_/pages/query/[path].tsx

15 lines
404 B
TypeScript
Raw Normal View History

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