Skip to content

Instantly share code, notes, and snippets.

/_document.js Secret

Created April 8, 2017 00:22
Show Gist options
  • Save anonymous/7250e04c4e46cfcfa32d336cd389f8e9 to your computer and use it in GitHub Desktop.
Save anonymous/7250e04c4e46cfcfa32d336cd389f8e9 to your computer and use it in GitHub Desktop.
import Document, { Head, Main, NextScript } from 'next/document';
import flush from 'styled-jsx/server'
export default class MyDocument extends Document {
static getInitialProps ({ renderPage }) {
const {html, head} = renderPage();
const styles = flush();
return { html, head, styles };
}
render () {
return (
<html>
<Head>
<style>{`body { margin: 0 } /* custom! */`}</style>
<title>Next.js 연습</title>
</Head>
<body>
<Main />
<NextScript />
</body>
</html>
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment