2016-12-22 05:10:54 +00:00
|
|
|
import Document, { Head, Main, NextScript } from 'next/document'
|
2017-05-07 12:25:33 +00:00
|
|
|
import { ServerStyleSheet } from 'styled-components'
|
2016-12-22 05:10:54 +00:00
|
|
|
|
|
|
|
export default class MyDocument extends Document {
|
|
|
|
render () {
|
2017-05-07 12:25:33 +00:00
|
|
|
const sheet = new ServerStyleSheet()
|
|
|
|
const main = sheet.collectStyles(<Main />)
|
|
|
|
const styleTags = sheet.getStyleElement()
|
2016-12-22 05:10:54 +00:00
|
|
|
return (
|
|
|
|
<html>
|
|
|
|
<Head>
|
|
|
|
<title>My page</title>
|
2017-05-07 12:25:33 +00:00
|
|
|
{styleTags}
|
2016-12-22 05:10:54 +00:00
|
|
|
</Head>
|
|
|
|
<body>
|
2017-05-07 12:25:33 +00:00
|
|
|
<div className='root'>
|
|
|
|
{main}
|
|
|
|
</div>
|
2016-12-22 05:10:54 +00:00
|
|
|
<NextScript />
|
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|