📌  相关文章
📜  如何添加 typescript tp create react app - TypeScript 代码示例

📅  最后修改于: 2022-03-11 14:48:36.801000             🧑  作者: Mango

代码示例6
// importing the provided NextJS type

import type { AppProps as NextAppProps } from "next/app";

// modified version - allows for custom pageProps type, falling back to 'any'

type AppProps

= { pageProps: P; } & Omit, "pageProps">; // use the new type like so, replacing 'CustomPageProps' with whatever you want export default function App({ Component, pageProps, }: AppProps) { //... }