Skip to content

Instantly share code, notes, and snippets.

@ryanbelke
Created May 5, 2020 00:01
Show Gist options
  • Select an option

  • Save ryanbelke/07308115af9dbe209ff1052d005f9e36 to your computer and use it in GitHub Desktop.

Select an option

Save ryanbelke/07308115af9dbe209ff1052d005f9e36 to your computer and use it in GitHub Desktop.
_app.js to use withData
/* _app.js */
import React from "react";
import App from "next/app";
import Head from "next/head";
import Layout from "../components/Layout";
import withData from "../lib/apollo";
class MyApp extends App {
render() {
const { Component, pageProps } = this.props;
return (
<>
<Head>
<link
rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"
integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm"
crossOrigin="anonymous"
/>
</Head>
<Layout>
<Component {...pageProps} />
</Layout>
</>
);
}
}
export default withData(MyApp);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment