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