Created
June 19, 2018 10:39
-
-
Save remy/cdfe48909c2e2eeab1c73b9a8ba8be71 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// via @github.com/electricg | |
// remove next.js custom scripts ala https://github.com/zeit/next.js/issues/3155#issuecomment-338708632 | |
import React from 'react'; | |
import { Head } from 'next/document'; | |
export default class MyHead extends Head { | |
render() { | |
const { head, styles } = this.context._documentProps; | |
return ( | |
<head {...this.props}> | |
{(head || []).map((h, i) => | |
React.cloneElement(h, { key: h.key || i }) | |
)} | |
{styles || null} | |
{this.props.children} | |
</head> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment