File tree 2 files changed +8
-0
lines changed
with-apollo-and-redux/lib
2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change 1
1
import React from 'react'
2
2
import PropTypes from 'prop-types'
3
3
import { ApolloProvider , getDataFromTree } from 'react-apollo'
4
+ import Head from 'next/head'
4
5
import initApollo from './initApollo'
5
6
import initRedux from './initRedux'
6
7
@@ -37,6 +38,9 @@ export default ComposedComponent => {
37
38
</ ApolloProvider >
38
39
)
39
40
await getDataFromTree ( app )
41
+ // getDataFromTree does not call componentWillUnmount
42
+ // head side effect therefore need to be cleared manually
43
+ Head . rewind ( )
40
44
41
45
// Extract query data from the store
42
46
const state = redux . getState ( )
Original file line number Diff line number Diff line change 1
1
import React from 'react'
2
2
import PropTypes from 'prop-types'
3
3
import { ApolloProvider , getDataFromTree } from 'react-apollo'
4
+ import Head from 'next/head'
4
5
import initApollo from './initApollo'
5
6
6
7
export default ComposedComponent => {
@@ -33,6 +34,9 @@ export default ComposedComponent => {
33
34
</ ApolloProvider >
34
35
)
35
36
await getDataFromTree ( app )
37
+ // getDataFromTree does not call componentWillUnmount
38
+ // head side effect therefore need to be cleared manually
39
+ Head . rewind ( )
36
40
37
41
// Extract query data from the Apollo's store
38
42
const state = apollo . getInitialState ( )
You can’t perform that action at this time.
0 commit comments