{"library":"react-redux","title":"React Redux Bindings","description":"React Redux is the official set of React bindings for the Redux state management library. It provides utilities and hooks like `Provider`, `useSelector`, `useDispatch`, and `connect` to integrate Redux stores with React components efficiently. The current stable version is 9.2.0, which includes compatibility for React 19. The package typically follows a release cadence that aligns with major React and Redux core updates, with bugfix and minor feature releases occurring regularly. Key differentiators include its official status, deep integration with the Redux ecosystem, and optimizations for performance in large-scale React applications, such as automatic batching of updates with React 18+.","language":"javascript","status":"active","last_verified":"Sun Apr 19","install":{"commands":["npm install react-redux"],"cli":null},"imports":["import { Provider } from 'react-redux';","import { useSelector } from 'react-redux';","import { useDispatch } from 'react-redux';","import { connect } from 'react-redux';","import { batch } from 'react-redux';","import type { TypedUseSelectorHook } from 'react-redux';"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import React from 'react';\nimport { createStore } from 'redux';\nimport { Provider, useSelector, useDispatch } from 'react-redux';\n\n// Redux Store Setup\ninterface RootState { count: number; }\nconst initialState: RootState = { count: 0 };\n\nfunction counterReducer(state = initialState, action: { type: string }) {\n  switch (action.type) {\n    case 'increment': return { count: state.count + 1 };\n    case 'decrement': return { count: state.count - 1 };\n    default: return state;\n  }\n}\n\nconst store = createStore(counterReducer);\n\n// React Component\nfunction Counter() {\n  const count = useSelector((state: RootState) => state.count);\n  const dispatch = useDispatch();\n\n  return (\n    <div>\n      <h1>Count: {count}</h1>\n      <button onClick={() => dispatch({ type: 'increment' })}>+</button>\n      <button onClick={() => dispatch({ type: 'decrement' })}>-</button>\n    </div>\n  );\n}\n\n// App Root\nfunction App() {\n  return (\n    <Provider store={store}>\n      <Counter />\n    </Provider>\n  );\n}\n\nexport default App;\n","lang":"typescript","description":"This quickstart demonstrates setting up a basic Redux store with `createStore`, providing it to a React application via `Provider`, and consuming the state and dispatching actions in a functional component using the `useSelector` and `useDispatch` hooks. It includes basic TypeScript types for the state.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}