Files
freeCodeCamp/packages/learn/gatsby-browser.js
2018-09-27 20:06:11 +05:30

17 lines
334 B
JavaScript

import React from 'react';
import { Provider } from 'react-redux';
import { createStore } from './src/redux/store';
export const wrapRootElement = ({ element }) => {
const store = createStore();
const ConnectedRootElement = (
<Provider store={store}>
{element}
</Provider>
);
return ConnectedRootElement;
};