next js document

Solutions on MaxInterview for next js document by the best coders in the world

showing results for - "next js document"
Juan José
01 Sep 2016
1import Document, { Html, Head, Main, NextScript } from 'next/document'
2
3class MyDocument extends Document {
4  static async getInitialProps(ctx) {
5    const initialProps = await Document.getInitialProps(ctx)
6    return { ...initialProps }
7  }
8
9  render() {
10    return (
11      <Html>
12        <Head />
13        <body>
14          <Main />
15          <NextScript />
16        </body>
17      </Html>
18    )
19  }
20}
21
22export default MyDocument
23