Skip to content
This repository has been archived by the owner on Dec 16, 2019. It is now read-only.

Commit

Permalink
help with inital unstyled load
Browse files Browse the repository at this point in the history
  • Loading branch information
mcansh committed Oct 9, 2017
1 parent 38cd95a commit 578a53c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pages/_document.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import React from 'react';
import Document, { Head, Main, NextScript } from 'next/document';
import flush from 'styled-jsx/server';

class Page extends Document {
static getInitialProps({ renderPage }) {
const { html, head, errorHtml, chunks } = renderPage();
const styles = flush();
return { html, head, errorHtml, chunks, styles };
}
render() {
return (
<html lang="en">
Expand Down

0 comments on commit 578a53c

Please sign in to comment.