Last active
July 15, 2018 18:16
-
-
Save drenther/f18dfa128afda958d1bb32fe9270afeb to your computer and use it in GitHub Desktop.
Custom App and Document Components
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
import React from 'react'; | |
import App, { Container } from 'next/app'; | |
import Header from '../components/Header'; | |
import OfflineSupport from '../components/OfflineSupport'; | |
class CustomApp extends App { | |
render() { | |
const { Component, pageProps } = this.props; | |
return ( | |
<Container> | |
<Header /> | |
<OfflineSupport /> | |
<Component {...pageProps} /> | |
</Container> | |
); | |
} | |
} | |
export default CustomApp; |
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
import Document, { Head, Main, NextScript } from 'next/document'; | |
export default class CustomDocument extends Document { | |
render() { | |
return ( | |
<html lang="en"> | |
<Head /> | |
<body> | |
<Main /> | |
<NextScript /> | |
</body> | |
</html> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment