Next.js: Layout

 20th August 2020 at 2:19pm

根据 wiki

In Next.js there's no concept of "global layout". Every page in your Next.js project is complete and self-sufficient.

Next.js 里面没有 global layout 的概念。它的每个页面都是“自给自足”的。因此你要在每个页面 import header 和 footer,类似这样:

import Meta from '../components/meta'
import Footer from '../components/footer'
export default () => (
  <div>
    <Meta />
    <p>hi there</p>
    <Footer />
  </div>
)