Created
February 19, 2018 21:14
-
-
Save saitonakamura/890dc276f97f798c41f7c52bb104c059 to your computer and use it in GitHub Desktop.
Next.js on Github Pages _document.js example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Document, { Head, Main, NextScript } from 'next/document' | |
export default class MyDocument extends Document { | |
render() { | |
return ( | |
<html> | |
<Head> | |
<link | |
rel="stylesheet" | |
href={`${this.props.__NEXT_DATA__.assetPrefix}/_next/static/style.css`} | |
/> | |
</Head> | |
<body> | |
<Main /> | |
<NextScript /> | |
</body> | |
</html> | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment