initial commit
This commit is contained in:
committed by
Mrugesh Mohapatra
parent
1314830576
commit
15aae9a57c
@ -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 />));
|
||||
};
|
||||
|
Reference in New Issue
Block a user