升級並玩得開心!
next-static-paths靜態地阻止使用Typescript和代碼生成的下一個js應用程序中未找到HTTP 404。
一個命令行界面,用於生成靜態類型和自定義路由助手功能
? a <TypedLink />組件將Next.js <Link />包裝並提供類型安全路徑匹配
助手的pathFor ,可以以類型安全的方式產生路徑
$ pnpm add next-static-paths
# or
$ yarn add next-static-paths
# or
$ npm install next-static-paths然後,從您的next.js應用程序root中,運行以下命令:
# For pnpm users
$ pnpx next-static-paths
# For yarn users
$ yarn next-static-paths
# For npm users
$ npx next-static-paths 
