initial commit
This commit is contained in:
committed by
Mrugesh Mohapatra
parent
1314830576
commit
15aae9a57c
@ -1,7 +1,22 @@
|
||||
/**
|
||||
* Implement Gatsby's Browser APIs in this file.
|
||||
*
|
||||
* See: https://www.gatsbyjs.org/docs/browser-apis/
|
||||
*/
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { Provider } from 'react-redux';
|
||||
import { ConnectedRouter } from 'react-router-redux';
|
||||
|
||||
// You can delete this file if you're not using it
|
||||
import { createStore } from './src/redux/store';
|
||||
|
||||
exports.replaceRouterComponent = ({ history }) => {
|
||||
const store = createStore(history || {});
|
||||
|
||||
const ConnectedRouterWrapper = ({ children }) => (
|
||||
<Provider store={store}>
|
||||
<ConnectedRouter history={history}>{children}</ConnectedRouter>
|
||||
</Provider>
|
||||
);
|
||||
ConnectedRouterWrapper.displayName = 'ConnectedRouterWrapper';
|
||||
ConnectedRouterWrapper.propTypes = {
|
||||
children: PropTypes.node
|
||||
};
|
||||
|
||||
return ConnectedRouterWrapper;
|
||||
};
|
||||
|
Reference in New Issue
Block a user