Unverified Commit a81913f1 authored by Henrik Wenz's avatar Henrik Wenz Committed by GitHub

Fix apollo example (#10696)

parent 3b287029
import React from 'react' import React from 'react'
import App from 'next/app' import App from 'next/app'
import Head from 'next/head'
import { ApolloProvider } from '@apollo/react-hooks' import { ApolloProvider } from '@apollo/react-hooks'
import createApolloClient from '../apolloClient' import createApolloClient from '../apolloClient'
...@@ -153,6 +154,10 @@ export const withApollo = ({ ssr = false } = {}) => PageComponent => { ...@@ -153,6 +154,10 @@ export const withApollo = ({ ssr = false } = {}) => PageComponent => {
// https://www.apollographql.com/docs/react/api/react-apollo.html#graphql-query-data-error // https://www.apollographql.com/docs/react/api/react-apollo.html#graphql-query-data-error
console.error('Error while running `getDataFromTree`', error) console.error('Error while running `getDataFromTree`', error)
} }
// getDataFromTree does not call componentWillUnmount
// head side effect therefore need to be cleared manually
Head.rewind()
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment