initial commit

This commit is contained in:
Stuart Taylor
2018-04-06 14:51:52 +01:00
committed by Mrugesh Mohapatra
parent 1314830576
commit 15aae9a57c
146 changed files with 44507 additions and 8380 deletions

View File

@ -1,7 +1,18 @@
/**
* Implement Gatsby's SSR (Server Side Rendering) APIs in this file.
*
* See: https://www.gatsbyjs.org/docs/ssr-apis/
*/
import React from 'react';
import { Provider } from 'react-redux';
import { renderToString } from 'react-dom/server';
// You can delete this file if you're not using it
import { createStore } from './src/redux/store';
exports.replaceRenderer = ({
history,
bodyComponent,
replaceBodyHTMLString
}) => {
const store = createStore(history);
const ConnectedBody = () => (
<Provider store={store}>{bodyComponent}</Provider>
);
replaceBodyHTMLString(renderToString(<ConnectedBody />));
};