Skip to content
This repository has been archived by the owner on Oct 26, 2021. It is now read-only.

Commit

Permalink
remove fetchAllData pending #16 resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
bdefore committed Dec 26, 2015
1 parent ee588c0 commit e254909
Showing 1 changed file with 10 additions and 29 deletions.
39 changes: 10 additions & 29 deletions src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,36 +111,17 @@ function setupRenderer() {
res.status(500);
hydrateOnClient();
} else {
// fetch and render:
try {
fetchAllData(
renderProps.components,
store.getState, store.dispatch,
renderProps.location,
renderProps.params
).then(() => {
// const component = (
// <Provider store={store} key="provider">
// <RoutingContext {...renderProps}/>
// </Provider>
// );
const component = (
<Provider store={store} key="provider">
<RoutingContext />
</Provider>
);

const status = getStatusFromRoutes(renderProps.routes);
if (status) {
res.status(status);
}
res.send('<!doctype html>\n' + ReactDOM.renderToString(<CustomHtml assets={tools.assets()} component={component} store={store} headers={res._headers} />));
});
} catch (err) {
console.error('DATA FETCHING ERROR:', pretty.render(err));
res.status(500);
hydrateOnClient();
const component = (
<Provider store={store} key="provider">
<RoutingContext {...renderProps}/>
</Provider>
);

const status = getStatusFromRoutes(renderProps.routes);
if (status) {
res.status(status);
}
res.send('<!doctype html>\n' + ReactDOM.renderToString(<CustomHtml assets={tools.assets()} component={component} store={store} headers={res._headers} />));
}
});
});
Expand Down

0 comments on commit e254909

Please sign in to comment.