2018-10-23 14:18:46 +01:00
|
|
|
import React from 'react';
|
2018-08-23 16:29:26 +01:00
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import { Provider } from 'react-redux';
|
|
|
|
|
|
|
|
import { createStore } from './src/redux/createStore';
|
2018-08-30 15:27:53 +01:00
|
|
|
import AppMountNotifier from './src/components/AppMountNotifier';
|
2019-02-28 15:44:35 +00:00
|
|
|
import layoutSelector from './utils/gatsby/layoutSelector';
|
2018-08-23 16:29:26 +01:00
|
|
|
|
|
|
|
const store = createStore();
|
|
|
|
|
|
|
|
export const wrapRootElement = ({ element }) => {
|
2018-08-30 15:27:53 +01:00
|
|
|
return (
|
|
|
|
<Provider store={store}>
|
2019-02-20 15:41:33 +03:00
|
|
|
<AppMountNotifier render={() => element} />
|
2018-08-30 15:27:53 +01:00
|
|
|
</Provider>
|
|
|
|
);
|
2018-08-23 16:29:26 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
wrapRootElement.propTypes = {
|
|
|
|
element: PropTypes.any
|
|
|
|
};
|
2019-01-23 00:53:35 +03:00
|
|
|
|
2019-02-28 15:44:35 +00:00
|
|
|
export const wrapPageElement = layoutSelector;
|
2019-03-06 10:00:19 +03:00
|
|
|
|
|
|
|
export const disableCorePrefetching = () => true;
|