testWhroh / issuehunt-dummy

0 stars 0 forks source link

Test #1

Open testWhroh opened 6 years ago

testWhroh commented 6 years ago

Custom Examples Is rendered on the server side Is used to change the initial server side rendered document markup Commonly used to implement server side rendering for css-in-js libraries like styled-components, glamorous or emotion. styled-jsx is included with Next.js by default. Pages in Next.js skip the definition of the surrounding document's markup. For example, you never include , , etc. To override that default behavior, you must create a file at

./pages/_document.js, where you can extend the Document class:

// _document is only rendered on the server side and not on the client side
// Event handlers like onClick can't be added to this file

// ./pages/_document.js
import Document, { Head, Main, NextScript } from 'next/document'

export default class MyDocument extends Document {
  static async getInitialProps(ctx) {
    const initialProps = await Document.getInitialProps(ctx)
    return { ...initialProps }
  }

  render() {
    return (
      <html>
        <Head>
          <style>{`body { margin: 0 } /* custom! */`}</style>
        </Head>
        <body className="custom_class">
          <Main />
          <NextScript />
        </body>
      </html>
    )
  }
}
IssueHuntBot commented 6 years ago

@rohjs has started working. Visit this issue on Issuehunt

IssueHuntBot commented 6 years ago

@rohjs funded this issue with $111. Visit this issue on Issuehunt

IssueHuntBot commented 6 years ago

@rohjs funded this issue with $111. Visit this issue on Issuehunt

IssueHuntBot commented 6 years ago

@rohjs has submitted output. Visit this issue on Issuehunt

IssueHuntBot commented 6 years ago

@testwhroh has rewarded. Visit this issue on Issuehunt