Skip to content

Commit

Permalink
Merge pull request #89 from smooth-code/fix-ssr
Browse files Browse the repository at this point in the history
chore: properly fix SSR
  • Loading branch information
gregberge authored May 23, 2018
2 parents c66702c + cd13658 commit 7292e22
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/server/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/* eslint-disable react/no-danger, no-underscore-dangle */
import React from 'react'
// eslint-disable-next-line import/no-unresolved, import/extensions
import { componentTracker } from 'loadable-components'
import { LOADABLE } from '../constants'
import { reset as resetTracker } from '../componentTracker'
import DeferredState from './DeferredState'

function isReactElement(element) {
Expand Down Expand Up @@ -174,7 +175,7 @@ export function getLoadableState(
tree = {},
) {
// Prevent duplicated components
resetTracker()
componentTracker.reset()

const queries = getQueriesFromTree({ rootElement, rootContext }, fetchRoot)

Expand Down
2 changes: 1 addition & 1 deletion src/server/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ describe('server side rendering', () => {
app = <App />
})

it.only('should traverse context', async () => {
it('should traverse context', async () => {
const loadableState = await getLoadableState(app)
expect(loadableState.tree).toEqual({
children: [{ children: [{ id: './Book' }], id: './Books' }],
Expand Down

0 comments on commit 7292e22

Please sign in to comment.