You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

gatsby-plugin-react-redux

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gatsby-plugin-react-redux

Gatsby plugin for React-Redux with built-in server-side rendering support

1.0.9
Source
npmnpm
Version published
Weekly downloads
818
5.14%
Maintainers
1
Weekly downloads
 
Created
Source

gatsby-plugin-react-redux

A Gatsby plugin for react-redux with built-in server-side rendering support.

Install

npm install --save gatsby-plugin-react-redux react-redux redux

How to use

./gatsby-config.js

module.exports = {
  plugins: [
    {
      resolve: `gatsby-plugin-react-redux`,
      options: {
        // [required] - path to module you created in step 1
        pathToCreateStoreModule: './src/state/createStore',
        // [optional] - options passed to `serialize-javascript`
        // info: https://github.com/yahoo/serialize-javascript#options
        // will be merged with these defaults:
        serialize: {
          space: 0,
          isJSON: true,
          unsafe: false,
        },
      },
    },
  ],
};

./src/state/createStore.js // same path you provided in gatsby-config

import { createStore } from 'redux';

function reducer() {
  //...
}

// preloadedState will be passed to you by the plugin
export default preloadedState => {
  return createStore(reducer, preloadedState);
};

License

MIT

Keywords

gatsby

FAQs

Package last updated on 30 May 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts