import Document , { Head , Main , NextDocumentContext , NextScript , } from 'next/document' ; import React from 'react' ; import { AppRegistry } from 'react-native' ; const globalStyles = `
  html,body{height:100%}
  body{overflow:hidden}
  #__next{display:flex;flex-direction:column;height:100%}
  input,textarea{outline:none}
  body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}
` ; export default class MyDocument extends Document { static async getInitialProps ( { renderPage } ) { AppRegistry . registerComponent ( 'Main' , ( ) => Main ) ; const { getStyleElement } = AppRegistry . getApplication ( 'Main' ) ; const page = renderPage ( ) ; const styles = [ < style dangerouslySetInnerHTML = { { __html : globalStyles } } key = "styles" / > , getStyleElement ( ) , ] ; return { ... page , styles : React . Children . toArray ( styles ) } ; } render ( ) { return ( < html lang = "en" > < Head > < meta charSet = "utf-8" / > < meta name = "viewport" content = "width=device-width, initial-scale=1" / > { } { } < link rel = "apple-touch-icon" sizes = "180x180" href = "/static/apple-touch-icon.png" / > < link rel = "icon" type = "image/png" sizes = "32x32" href = "/static/favicon-32x32.png" / > < link rel = "icon" type = "image/png" sizes = "16x16" href = "/static/favicon-16x16.png" / > < /Head> < body > < Main /> < NextScript / > < /body> < /html>); } }