author BounceCode, Inc.
 *  packageDocumentation import React from 'react' ; import Document , { Html , Head , Main , NextScript } from 'next/document' ; import { ServerStyleSheets } from '@material-ui/styles' ; class MyDocument extends Document { render ( ) { return ( < Html lang = "en" > < Head > < meta charSet = "utf-8" / > < meta name = "viewport" content = "width=device-width, initial-scale=1, shrink-to-fit=no" / > < meta name = "theme-color" content = "#000000" / > { } { } { } < link rel = "stylesheet" type = "text/css" href = "https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Roboto+Slab:400,700|Material+Icons" / > < link href = "https://use.fontawesome.com/releases/v5.0.10/css/all.css" rel = "stylesheet" / > < script dangerouslySetInnerHTML = { { __html : `
              var $buoop = {required:{e:-4,f:-3,o:-3,s:-1,c:-3},insecure:true,unsupported:true,api:2020.04 }; 
              function $buo_f(){ 
              var e = document.createElement("script"); 
              e.src = "//browser-update.org/update.min.js"; 
              document.body.appendChild(e);
              };
              try {document.addEventListener("DOMContentLoaded", $buo_f,false)}
              catch(e){window.attachEvent("onload", $buo_f)}
            ` , } } /> < /Head> < body > < Main /> < NextScript / > < /body> < /Html>); } } MyDocument . getInitialProps = async ( ctx ) => { const sheets = new ServerStyleSheets ( ) ; const originalRenderPage = ctx . renderPage ; ctx . renderPage = ( ) => originalRenderPage ( { enhanceApp : App => props => sheets . collect ( < App { ... props } / > ) , } ) ; const initialProps = await Document . getInitialProps ( ctx ) ; return { ... initialProps , styles : [ ... React . Children . toArray ( initialProps . styles ) , sheets . getStyleElement ( ) , ] , } ; } ; export default MyDocument ;