Files
transform/pages/_app.js
T
Ritesh Kumar 8acda3afd4 upgrade to next 6 (#78)
* upgrade to next 6

* upgrade to next 6
2018-04-22 11:54:45 +05:30

30 lines
681 B
JavaScript

import App, { Container } from "next/app";
import React from "react";
import { withRouter } from "next/router";
import Layout from "../components/Layout";
class MyApp extends App {
static async getInitialProps({ Component, router, ctx }) {
let pageProps = {};
if (Component.getInitialProps) {
pageProps = await Component.getInitialProps(ctx);
}
return { pageProps };
}
render() {
const { Component, pageProps, router } = this.props;
return (
<Layout pathname={router.pathname}>
<Container>
<Component url={router} {...pageProps} />
</Container>
</Layout>
);
}
}
export default withRouter(MyApp);