MCPcopy
hub / github.com/reduxjs/react-redux

github.com/reduxjs/react-redux @v9.3.0 sqlite

repository ↗ · DeepWiki ↗ · release v9.3.0 ↗
544 symbols 904 edges 63 files 0 documented · 0%
README

React Redux

Official React bindings for Redux. Performant and flexible.

GitHub Workflow Status npm version npm downloads #redux channel on Discord

Installation

Create a React Redux App

The recommended way to start new apps with React and Redux is by using our official Redux+TS template for Vite, or by creating a new Next.js project using Next's with-redux template.

Both of these already have Redux Toolkit and React-Redux configured appropriately for that build tool, and come with a small example app that demonstrates how to use several of Redux Toolkit's features.

# Vite with our Redux+TS template
# (using the `degit` tool to clone and extract the template)
npx degit reduxjs/redux-templates/packages/vite-template-redux my-app

# Next.js using the `with-redux` template
npx create-next-app --example with-redux my-app

An Existing React App

React Redux 9.0 requires React 18 or later

To use React Redux with your React app, install it as a dependency:

# If you use npm:
npm install react-redux

# Or if you use Yarn:
yarn add react-redux

You'll also need to install Redux and set up a Redux store in your app.

This assumes that you’re using npm package manager with a module bundler like Webpack or Browserify to consume CommonJS modules.

If you don’t yet use npm or a modern module bundler, and would rather prefer a single-file UMD build that makes ReactRedux available as a global object, you can grab a pre-built version from cdnjs. We don’t recommend this approach for any serious application, as most of the libraries complementary to Redux are only available on npm.

Documentation

The React Redux docs are published at https://react-redux.js.org .

How Does It Work?

The post The History and Implementation of React-Redux explains what it does, how it works, and how the API and implementation have evolved over time.

There's also a Deep Dive into React-Redux talk that covers some of the same material at a higher level.

License

MIT

Extension points exported contracts — how you extend this code

GreetingProps (Interface)
(no doc)
test/integration/server-rendering.spec.tsx
PassthroughPropsType (Interface)
(no doc)
test/components/connect.spec.tsx
OwnProps (Interface)
(no doc)
test/typetests/connect-mapstate-mapdispatch.test-d.tsx
CounterState (Interface)
(no doc)
test/hooks/hooks.withTypes.test.tsx
DispatchProp (Interface)
(no doc)
src/types.ts
ProviderProps (Interface)
(no doc)
src/components/Provider.tsx
Subscription (Interface)
(no doc)
src/utils/Subscription.ts
PureSelectorFactoryComparisonOptions (Interface)
(no doc)
src/connect/selectorFactory.ts

Core symbols most depended-on inside this repo

useSelector
called by 27
src/hooks/useSelector.ts
shallowEqual
called by 14
src/utils/shallowEqual.ts
isPlainObject
called by 9
src/utils/isPlainObject.ts
bindActionCreators
called by 7
src/utils/bindActionCreators.ts
useDispatch
called by 7
src/hooks/useDispatch.ts
mergeProps
called by 5
test/typetests/react-redux-types.test-d.tsx
mapStateToProps
called by 4
test/typetests/react-redux-types.test-d.tsx
render
called by 4
test/typetests/react-redux-types.test-d.tsx

Shape

Function 222
Interface 132
Class 116
Method 74

Languages

TypeScript100%

Modules by API surface

test/components/connect.spec.tsx180 symbols
test/typetests/connect-options-and-issues.test-d.tsx69 symbols
test/typetests/react-redux-types.test-d.tsx54 symbols
test/components/Provider.spec.tsx37 symbols
test/hooks/useSelector.spec.tsx23 symbols
test/typetests/connect-mapstate-mapdispatch.test-d.tsx20 symbols
test/typetests/hooks.test-d.tsx17 symbols
src/components/connect.tsx16 symbols
src/utils/Subscription.ts15 symbols
test/integration/server-rendering.spec.tsx12 symbols
src/connect/selectorFactory.ts12 symbols
test/integration/ssr.spec.tsx10 symbols

Dependencies from manifests, versioned

@dipakparmar/docusaurus-plugin-umami2.0.6 · 1×
@docusaurus/core3.6.3 · 1×
@docusaurus/preset-classic3.6.3 · 1×
@getcanary/docusaurus-theme-search-pagefind1.0.2 · 1×
@getcanary/web1.0.12 · 1×
@microsoft/api-extractor7.47.0 · 1×
@reduxjs/toolkit2.2.5 · 1×
@testing-library/dom10.4.0 · 1×
@testing-library/jest-dom6.6.3 · 1×
@testing-library/react16.1.0 · 1×
@types/node20.14.2 · 1×
@types/prop-types15.7.12 · 1×

For agents

$ claude mcp add react-redux \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact