Skip to content

Commit

Permalink
Fix apollo example (#10696)
Browse files Browse the repository at this point in the history
  • Loading branch information
HaNdTriX committed Feb 25, 2020
1 parent 3b28702 commit a81913f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions examples/with-apollo/lib/apollo.js
@@ -1,5 +1,6 @@
import React from 'react'
import App from 'next/app'
import Head from 'next/head'
import { ApolloProvider } from '@apollo/react-hooks'
import createApolloClient from '../apolloClient'

Expand Down Expand Up @@ -153,6 +154,10 @@ export const withApollo = ({ ssr = false } = {}) => PageComponent => {
// https://www.apollographql.com/docs/react/api/react-apollo.html#graphql-query-data-error
console.error('Error while running `getDataFromTree`', error)
}

// getDataFromTree does not call componentWillUnmount
// head side effect therefore need to be cleared manually
Head.rewind()
}
}

Expand Down

0 comments on commit a81913f

Please sign in to comment.