How reduxjs/react-redux works
React Redux provides React components and hooks that expose a Redux store to a component tree, select state, and bind dispatch behavior. The main workflow begins with Provider publishing the store and subscription context; components then use hooks or connect to read state and dispatch actions, with subscriptions coordinating updates. The connect path additionally derives and merges component props. The graph reflects the README’s stated role and the sampled implementation; unsampled modules are included where the source index identifies them, but their internal behavior is not inferred beyond listed references.
Main entry points: connect.tsx connect wrapper · selectorFactory.ts Props selector · Provider.tsx Provider · exports.ts Public exports
Components 20
Store Context
- Provider
src/components/Provider.tsx - Redux context
src/components/Context.ts
React Bindings
- useSelector
src/hooks/useSelector.ts - useDispatch
src/hooks/useDispatch.ts - useStore
src/hooks/useStore.ts - Context hook
src/hooks/useReduxContext.ts - Public exports
src/exports.ts
Connected Components
- connect wrapper
src/components/connect.tsx - Props selector
src/connect/selectorFactory.ts - State mapping
src/connect/mapStateToProps.ts - Dispatch mapping
src/connect/mapDispatchToProps.ts - Prop merging
src/connect/mergeProps.ts - Mapper wrapping
src/connect/wrapMapToProps.ts
Shared Internals
- Subscriptions
src/utils/Subscription.ts - Layout effect
src/utils/useIsomorphicLayoutEffect.ts - Shallow equality
src/utils/shallowEqual.ts
Other components
- React application
- Redux store
- React runtime
- External selector utility
Connections 31
- React application → Provider: wraps tree
README.md - Provider → Redux store: receives store
src/components/Provider.tsx - Provider → Subscriptions: creates subscription
src/components/Provider.tsx - Provider → Redux context: provides context
src/components/Provider.tsx - Provider → Layout effect: uses effect
src/components/Provider.tsx - Redux context → React runtime: creates context
src/components/Context.ts - connect wrapper → Redux context: reads context
src/components/connect.tsx - connect wrapper → Subscriptions: creates subscription
src/components/connect.tsx - connect wrapper → Layout effect: uses effect
src/components/connect.tsx - connect wrapper → Props selector: configures selector
src/components/connect.tsx - connect wrapper → State mapping: configures mapper
src/components/connect.tsx - connect wrapper → Dispatch mapping: configures mapper
src/components/connect.tsx - connect wrapper → Prop merging: configures merger
src/components/connect.tsx - connect wrapper → Shallow equality: uses equality
src/components/connect.tsx - Props selector → State mapping: calls mapper
src/connect/selectorFactory.ts - Props selector → Dispatch mapping: calls mapper
src/connect/selectorFactory.ts - Props selector → Prop merging: merges props
src/connect/selectorFactory.ts - Props selector → Mapper wrapping: initializes mappers
src/connect/mapStateToProps.ts - Props selector → Mapper wrapping: initializes mappers
src/connect/mapDispatchToProps.ts - Props selector → React runtime: checks subselectors
src/connect/selectorFactory.ts - useSelector → Context hook: gets context
src/hooks/useSelector.ts - useSelector → Redux context: reads store context
src/hooks/useSelector.ts - useSelector → External selector utility: subscribes and selects
src/hooks/useSelector.ts - useStore → Context hook: gets context
src/hooks/useStore.ts - Context hook → Redux context: reads context
src/hooks/useReduxContext.ts - useDispatch → useStore: gets store
src/hooks/useDispatch.ts - Public exports → Provider: exports
src/exports.ts - Public exports → connect wrapper: exports
src/exports.ts - Public exports → useSelector: exports
src/exports.ts - Public exports → useDispatch: exports
src/exports.ts - Public exports → useStore: exports
src/exports.ts