Sharing State Between Redux Reducers - HedgeDoc
<center> # Sharing State Between Redux Reducers *Originally published 2016-02-18 on [](* </center> When writing an app using Redux and React, you may run into the common problem of having to share state between multiple components in your app. Don’t worry, you aren’t the first to have this problem, here are some resources to help you out. ## Your options: - don’t use `combineReducers` (write your own that shares state/selector between two components) - use the `redux-thunk` middleware - pass pre-bound selectors to the store down through your components or `mapDispatchToProps` (as recommended by `reselect`) - use a global store like `` and call `` to directly access state ## On Managing state hierarchy in general: <ul> <li><a href="">How to hand global state data into deeply nested components in redux?</a></li> <li><a href="">Should I put all component state into the redux store? </a></li> <li><a href="">How to reduce nested data in redux?</a></li> </ul> <strong>Specifically on sharing state between reducers:</strong> <ul> <li><a href="">Accessing other parts of the state when using combined reducers</a></li> <li><a href="">How do I share readonly state between several reducers?</a></li> <li><a href="">Sharing state between two redux reducers</a></li> <li><a href="">Redux: where to prepare shared data</a></li> <li><a href="">How to compose redux reducers with dependent state</a></li> <li><a href="">Redux: do I have to import store in all my containers to access shared state?</a></li> <li><a href="">Redux reducer state shape design for dependent state slices?</a></li> </ul> Related Documentation: <ul> <li><a href="">Redux Docs: Reducers</a></li> <li><a href="">Redux Docs: combineReducers</a></li> <li><a href="">github: reduce-reducers</a> (combineReducers wo/ forced namespacing)</li> <li><a href=""> lesson: implementing a redux store from scratch</a></li> </ul>

Recent posts:

Back to top