From 6e6cf3a88a16e4eda407db3ed8fc7ca7b3526d6f Mon Sep 17 00:00:00 2001 From: Trang Le Date: Mon, 27 Jun 2022 10:58:19 +0000 Subject: [PATCH] feat: add type safety for getStaticProps --- pages/[pageId].tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pages/[pageId].tsx b/pages/[pageId].tsx index b92d68b..b9d573f 100644 --- a/pages/[pageId].tsx +++ b/pages/[pageId].tsx @@ -1,10 +1,12 @@ import * as React from 'react' +import { GetStaticProps } from 'next' import { isDev, domain } from 'lib/config' import { getSiteMap } from 'lib/get-site-map' import { resolveNotionPage } from 'lib/resolve-notion-page' +import { PageProps, Params } from 'lib/types' import { NotionPage } from 'components' -export const getStaticProps = async (context) => { +export const getStaticProps: GetStaticProps = async (context) => { const rawPageId = context.params.pageId as string try {