在nextJs中找不到_app.js

Tâm*_* Đỗ 8 javascript frontend web reactjs next.js

我正在用来npx create-next-app创建我的 NextJs 项目,现在我想通过以下方式为其添加全局样式bootstrap

下载后bootstrap,它建议我添加全局样式,pages/_app.js但我没有找到类似的文件。谢谢你帮助我

在此输入图像描述

小智 0

当你创建一个新的 Nextjs 项目时,你没有这个文件

您应该在根页面中创建此文件

_app.js 或 _app.tsx(如果您使用打字稿)

const MyApp=()=>{
    return(
       enter code here
    )
  }
export default MyApp
Run Code Online (Sandbox Code Playgroud)