// @flow import * as React from 'react'; import Document, { Head, Main, NextScript } from 'next/document'; import { ServerStyleSheet } from 'styled-components'; import { GA_TRACKING_ID } from '../lib/gtag'; export default class MyDocument extends Document { // $FlowFixMe static getInitialProps({ renderPage }) { const sheet = new ServerStyleSheet(); const page = renderPage(App => props => sheet.collectStyles() ); const styleTags = sheet.getStyleElement(); return { ...page, styleTags }; } render() { return ( {this.props.styleTags}
{/* Global Site Tag (gtag.js) - Google Analytics */}