Next-js组件使用泛型类型传递异步数据
Next-js组件使用泛型类型传递异步数据
定义类型
1 | type PageProps = { |
返回属性
1 | // https://github.com/vercel/next.js/blob/canary/examples/cms-wordpress/pages/index.js |
使用
1 | const Home: NextPage<PageProps> = (props, context) => { |
定义类型
1 | type PageProps = { |
返回属性
1 | // https://github.com/vercel/next.js/blob/canary/examples/cms-wordpress/pages/index.js |
使用
1 | const Home: NextPage<PageProps> = (props, context) => { |