mirror of
https://github.com/expo/expo-cli.git
synced 2026-11-14 18:06:30 -10:00
42 lines
1.3 KiB
JavaScript
42 lines
1.3 KiB
JavaScript
import { extractCritical } from 'emotion-server';
|
|
import Document, { Head, Main, NextScript } from 'next/document';
|
|
import React from 'react';
|
|
|
|
export default class MyDocument extends Document {
|
|
static getInitialProps({ renderPage }) {
|
|
const page = renderPage();
|
|
const styles = extractCritical(page.html);
|
|
return { ...page, ...styles };
|
|
}
|
|
|
|
constructor(props) {
|
|
super(props);
|
|
const { __NEXT_DATA__, ids } = props;
|
|
if (ids) {
|
|
__NEXT_DATA__.ids = ids;
|
|
}
|
|
}
|
|
|
|
render() {
|
|
return (
|
|
<html>
|
|
<Head>
|
|
<title>Expo Developer Tools</title>
|
|
<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" />
|
|
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5" />
|
|
<meta name="msapplication-TileColor" content="#da532c" />
|
|
<link rel="manifest" href="/static/site.webmanifest" />
|
|
<meta name="theme-color" content="#ffffff" />
|
|
<style dangerouslySetInnerHTML={{ __html: this.props.css }} />
|
|
</Head>
|
|
<body>
|
|
<Main />
|
|
<NextScript />
|
|
</body>
|
|
</html>
|
|
);
|
|
}
|
|
}
|