1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00

Update README.md

This commit is contained in:
Guillermo Rauch 2016-12-19 14:25:03 -08:00 committed by GitHub
parent 3c25bef2ea
commit 1980726208

View file

@ -286,20 +286,17 @@ import Document, { Head, Main, NextScript } from `next/document`
export default class MyDocument extends Document {
static async getInitialProps (ctx) {
const props = await Document.getInitialProps(ctx)
// append a custom `value`
return { ...props, value: 'hi' }
return { ...props, customValue: 'hi there!' }
}
render () {
return (
<html>
<Head>
{/* custom style */}
<style>{`body { margin: 0 }`}</style>
<style>{`body { margin: 0 } /* custom! */`}</style>
</Head>
{/* set className to body */}
<body className="hi">
{this.props.value}
<body className="custom_class">
{this.props.customValue}
<Main />
<NextScript />
</body>