Commit 19807262 authored by Guillermo Rauch's avatar Guillermo Rauch Committed by GitHub

Update README.md

parent 3c25bef2
......@@ -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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment