cc-core-cli
Version:
Command Line Interface tool for generating project templates for the (Your Platform's Name) platform.
43 lines (38 loc) • 799 B
JavaScript
const newrelic = require("newrelic");
import Document, {
Html,
Head,
Main,
NextScript,
} from "next/document";
class MyDocument extends Document {
static async getInitialProps(
ctx
) {
const initialProps = await Document.getInitialProps(ctx);
const browserTimingHeader = newrelic.getBrowserTimingHeader({
hasToRemoveScriptWrapper: true,
});
return {
...initialProps,
browserTimingHeader,
};
}
render() {
return (
<Html>
<Head>
<script
type="text/javascript"
dangerouslySetInnerHTML={{ __html: this.props.browserTimingHeader }}
/>
</Head>
<body>
<Main />
<NextScript />
</body>
</Html>
);
}
}
export default MyDocument;