Getting Started
    Core Concepts
    Building Features
    API Reference
    Configuration
    Deployment
    Upgrading
    Migrating
    Pro
    Misc
    Shakacode logoShakaCodeDeveloped by

    Copyright 2026 ShakaCode

    Press Ctrl+K to search anytime
    Burger
    ShakaCode WebsiteCommunityReact on Rails ProGithubSmallView on Github
    Documentation
      Getting Started
      Core Concepts
      Building Features
      API Reference
      Configuration
      Deployment
      Upgrading
      Migrating
      Pro
      Misc
      Shakacode logoShakaCodeDeveloped by

      Copyright 2026 ShakaCode

      Communication between React Components and Redux Reducers

      Communication Between Components

      See Sharing State Between Components.

      Redux Reducers

      The helloWorld/reducers/index.jsx example that results from running the generator with the Redux option may be slightly confusing because of its simplicity. For clarity, what follows is a more fleshed-out example of what a reducer might look like:

      import usersReducer from './usersReducer';
      import blogPostsReducer from './blogPostsReducer';
      import commentsReducer from './commentsReducer';
      // ...
      
      import { $$initialState as $$usersState } from './usersReducer';
      import { $$initialState as $$blogPostsState } from './blogPostsReducer';
      import { $$initialState as $$commentsState } from './commentsReducer';
      // ...
      
      export default {
        $$usersStore: usersReducer,
        $$blogPostsStore: blogPostsReducer,
        $$commentsStore: commentsReducer,
        // ...
      };
      
      export const initialStates = {
        $$usersState,
        $$blogPostsState,
        $$commentsState,
        // ...
      };