Skip to content

Instantly share code, notes, and snippets.

@drenther
Last active July 15, 2018 18:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drenther/f18dfa128afda958d1bb32fe9270afeb to your computer and use it in GitHub Desktop.
Save drenther/f18dfa128afda958d1bb32fe9270afeb to your computer and use it in GitHub Desktop.
Custom App and Document Components
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;
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