1npm install --save gatsby-plugin-react-redux react-redux redux
2
3//
4yarn add gatsby-plugin-react-redux react-redux redux
5
6// How to use
7// same path you provided in gatsby-config
8// ./src/state/createStore.js
9
10import { createStore } from 'redux';
11
12function reducer() {
13 //...
14}
15
16// preloadedState will be passed in by the plugin
17export default preloadedState => {
18 return createStore(reducer, preloadedState);
19};