Skip to content

Update Docusaurus to v3 and switch search to Canary + Pagefind #4788

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Apr 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ description: 'FAQ Index: Frequently Asked Questions about Redux'
- [Is it OK to have more than one middleware chain in my store enhancer? What is the difference between next and dispatch in a middleware function?](faq/StoreSetup.md#is-it-ok-to-have-more-than-one-middleware-chain-in-my-store-enhancer-what-is-the-difference-between-next-and-dispatch-in-a-middleware-function)
- [How do I subscribe to only a portion of the state? Can I get the dispatched action as part of the subscription?](faq/StoreSetup.md#how-do-i-subscribe-to-only-a-portion-of-the-state-can-i-get-the-dispatched-action-as-part-of-the-subscription)
- **Actions**
- [Why should type be a string, or at least serializable? Why should my action types be constants?](faq/Actions.md#why-should-type-be-a-string-or-at-least-serializable-why-should-my-action-types-be-constants)
- [Why should type be a string, or at least serializable? Why should my action types be constants?](faq/Actions.md#why-should-type-be-a-string-why-should-my-action-types-be-constants)
- [Is there always a one-to-one mapping between reducers and actions?](faq/Actions.md#is-there-always-a-one-to-one-mapping-between-reducers-and-actions)
- [How can I represent “side effects” such as AJAX calls? Why do we need things like “action creators”, “thunks”, and “middleware” to do async behavior?](faq/Actions.md#how-can-i-represent-side-effects-such-as-ajax-calls-why-do-we-need-things-like-action-creators-thunks-and-middleware-to-do-async-behavior)
- [What async middleware should I use? How do you decide between thunks, sagas, observables, or something else?](faq/Actions.md#what-async-middleware-should-i-use-how-do-you-decide-between-thunks-sagas-observables-or-something-else)
Expand Down Expand Up @@ -62,7 +62,7 @@ description: 'FAQ Index: Frequently Asked Questions about Redux'
- [Why isn't my component re-rendering, or my mapStateToProps running?](faq/ReactRedux.md#why-isnt-my-component-re-rendering-or-my-mapstatetoprops-running)
- [Why is my component re-rendering too often?](faq/ReactRedux.md#why-is-my-component-re-rendering-too-often)
- [How can I speed up my mapStateToProps?](faq/ReactRedux.md#how-can-i-speed-up-my-mapstatetoprops)
- [Why don't I have this.props.dispatch available in my connected component?](faq/ReactRedux.md#why-dont-i-have-this-props-dispatch-available-in-my-connected-component)
- [Why don't I have this.props.dispatch available in my connected component?](faq/ReactRedux.md#why-dont-i-have-thispropsdispatch-available-in-my-connected-component)
- [Should I only connect my top component, or can I connect multiple components in my tree?](faq/ReactRedux.md#should-i-only-connect-my-top-component-or-can-i-connect-multiple-components-in-my-tree)
- **Miscellaneous**
- [Are there any larger, “real” Redux projects?](faq/Miscellaneous.md#are-there-any-larger-real-redux-projects)
Expand Down
6 changes: 3 additions & 3 deletions docs/api/Store.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ _(any)_: The current state tree of your application.

Dispatches an action. This is the only way to trigger a state change.

The store's reducer function will be called with the current [`getState()`](#getState) result and the given `action` synchronously. Its return value will be considered the next state. It will be returned from [`getState()`](#getState) from now on, and the change listeners will immediately be notified.
The store's reducer function will be called with the current [`getState()`](#getstate) result and the given `action` synchronously. Its return value will be considered the next state. It will be returned from [`getState()`](#getstate) from now on, and the change listeners will immediately be notified.

:::caution

Expand Down Expand Up @@ -83,7 +83,7 @@ store.dispatch(addTodo('Read about the middleware'))

### subscribe(listener)

Adds a change listener. It will be called any time an action is dispatched, and some part of the state tree may potentially have changed. You may then call [`getState()`](#getState) to read the current state tree inside the callback.
Adds a change listener. It will be called any time an action is dispatched, and some part of the state tree may potentially have changed. You may then call [`getState()`](#getstate) to read the current state tree inside the callback.

You may call [`dispatch()`](#dispatchaction) from a change listener, with the following caveats:

Expand All @@ -99,7 +99,7 @@ To unsubscribe the change listener, invoke the function returned by `subscribe`.

#### Arguments

1. `listener` (_Function_): The callback to be invoked any time an action has been dispatched, and the state tree might have changed. You may call [`getState()`](#getState) inside this callback to read the current state tree. It is reasonable to expect that the store's reducer is a pure function, so you may compare references to some deep path in the state tree to learn whether its value has changed.
1. `listener` (_Function_): The callback to be invoked any time an action has been dispatched, and the state tree might have changed. You may call [`getState()`](#getstate) inside this callback to read the current state tree. It is reasonable to expect that the store's reducer is a pure function, so you may compare references to some deep path in the state tree to learn whether its value has changed.

##### Returns

Expand Down
2 changes: 1 addition & 1 deletion docs/api/api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ See the [**Migrating to Modern Redux** page](../usage/migrating-to-modern-redux.
## Store API

- [Store](Store.md)
- [getState()](Store.md#getState)
- [getState()](Store.md#getstate)
- [dispatch(action)](Store.md#dispatchaction)
- [subscribe(listener)](Store.md#subscribelistener)
- [replaceReducer(nextReducer)](Store.md#replacereducernextreducer)
2 changes: 1 addition & 1 deletion docs/api/applyMiddleware.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ The original Redux [`createStore`](createStore.md) method does not understand wh

## Arguments

- `...middleware` (_arguments_): Functions that conform to the Redux _middleware API_. Each middleware receives [`Store`](Store.md)'s [`dispatch`](Store.md#dispatchaction) and [`getState`](Store.md#getState) functions as named arguments, and returns a function. That function will be given the `next` middleware's dispatch method, and is expected to return a function of `action` calling `next(action)` with a potentially different argument, or at a different time, or maybe not calling it at all. The last middleware in the chain will receive the real store's [`dispatch`](Store.md#dispatchaction) method as the `next` parameter, thus ending the chain. So, the middleware signature is `({ getState, dispatch }) => next => action`.
- `...middleware` (_arguments_): Functions that conform to the Redux _middleware API_. Each middleware receives [`Store`](Store.md)'s [`dispatch`](Store.md#dispatchaction) and [`getState`](Store.md#getstate) functions as named arguments, and returns a function. That function will be given the `next` middleware's dispatch method, and is expected to return a function of `action` calling `next(action)` with a potentially different argument, or at a different time, or maybe not calling it at all. The last middleware in the chain will receive the real store's [`dispatch`](Store.md#dispatchaction) method as the `next` parameter, thus ending the chain. So, the middleware signature is `({ getState, dispatch }) => next => action`.

### Returns

Expand Down
21 changes: 2 additions & 19 deletions docs/faq/Actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,7 @@ title: Actions
sidebar_label: Actions
---

# Redux FAQ: Actions

## Table of Contents

- [Redux FAQ: Actions](#redux-faq-actions)
- [Table of Contents](#table-of-contents)
- [Actions](#actions)
- [Why should `type` be a string, or at least serializable? Why should my action types be constants?](#why-should-type-be-a-string-or-at-least-serializable-why-should-my-action-types-be-constants)
- [Further information](#further-information)
- [Is there always a one-to-one mapping between reducers and actions?](#is-there-always-a-one-to-one-mapping-between-reducers-and-actions)
- [Further information](#further-information-1)
- [How can I represent “side effects” such as AJAX calls? Why do we need things like “action creators”, “thunks”, and “middleware” to do async behavior?](#how-can-i-represent-side-effects-such-as-ajax-calls-why-do-we-need-things-like-action-creators-thunks-and-middleware-to-do-async-behavior)
- [Further information](#further-information-2)
- [What async middleware should I use? How do you decide between thunks, sagas, observables, or something else?](#what-async-middleware-should-i-use-how-do-you-decide-between-thunks-sagas-observables-or-something-else)
- [Should I dispatch multiple actions in a row from one action creator?](#should-i-dispatch-multiple-actions-in-a-row-from-one-action-creator)
- [Further information](#further-information-3)

## Actions
## Redux FAQ: Actions

### Why should `type` be a string? Why should my action types be constants?

Expand Down Expand Up @@ -145,7 +128,7 @@ Try to avoid dispatching several times synchronously in a row in the places wher

**Documentation**

- [FAQ: Performance - Reducing Update Events](./Performance.md#performance-update-events)
- [FAQ: Performance - Reducing Update Events](./Performance.md#how-can-i-reduce-the-number-of-store-update-events)

**Articles**

Expand Down
10 changes: 1 addition & 9 deletions docs/faq/CodeStructure.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,7 @@ sidebar_label: Code Structure

import { DetailedExplanation } from '../components/DetailedExplanation'

# Redux FAQ: Code Structure

## Table of Contents

- [What should my file structure look like? How should I group my action creators and reducers in my project? Where should my selectors go?](#what-should-my-file-structure-look-like-how-should-i-group-my-action-creators-and-reducers-in-my-project-where-should-my-selectors-go)
- [How should I split my logic between reducers and action creators? Where should my “business logic” go?](#how-should-i-split-my-logic-between-reducers-and-action-creators-where-should-my-business-logic-go)
- [Why should I use action creators?](#why-should-i-use-action-creators)
- [Where should websockets and other persistent connections live?](#where-should-websockets-and-other-persistent-connections-live)
- [How can I use the Redux store in non-component files?](#how-can-i-use-the-redux-store-in-non-component-files)
## Redux FAQ: Code Structure

## What should my file structure look like? How should I group my action creators and reducers in my project? Where should my selectors go?

Expand Down
13 changes: 1 addition & 12 deletions docs/faq/DesignDecisions.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,7 @@ title: Design Decisions
sidebar_label: Design Decisions
---

# Redux FAQ: Design Decisions

## Table of Contents

- [Why doesn't Redux pass the state and action to subscribers?](#why-doesnt-redux-pass-the-state-and-action-to-subscribers)
- [Why doesn't Redux support using classes for actions and reducers?](#why-doesnt-redux-support-using-classes-for-actions-and-reducers)
- [Why does the middleware signature use currying?](#why-does-the-middleware-signature-use-currying)
- [Why does applyMiddleware use a closure for dispatch?](#why-does-applymiddleware-use-a-closure-for-dispatch)
- [Why doesn't `combineReducers` include a third argument with the entire state when it calls each reducer?](#why-doesnt-combinereducers-include-a-third-argument-with-the-entire-state-when-it-calls-each-reducer)
- [Why doesn't mapDispatchToProps allow use of return values from `getState()` or `mapStateToProps()`?](#why-doesnt-mapdispatchtoprops-allow-use-of-return-values-from-getstate-or-mapstatetoprops)

## Design Decisions
## Redux FAQ: Design Decisions

### Why doesn't Redux pass the state and action to subscribers?

Expand Down
22 changes: 1 addition & 21 deletions docs/faq/ImmutableData.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,7 @@ title: Immutable Data
sidebar_label: Immutable Data
---

# Redux FAQ: Immutable Data

## Table of Contents

- [What are the benefits of immutability?](#what-are-the-benefits-of-immutability)
- [Why is immutability required by Redux?](#why-is-immutability-required-by-redux)
- [Why does Redux’s use of shallow equality checking require immutability?](#why-does-reduxs-use-of-shallow-equality-checking-require-immutability)
- [How do Shallow and Deep Equality Checking differ?](#how-do-shallow-and-deep-equality-checking-differ)
- [How does Redux use shallow equality checking?](#how-does-redux-use-shallow-equality-checking)
- [How does `combineReducers` use shallow equality checking?](#how-does-combinereducers-use-shallow-equality-checking)
- [How does React-Redux use shallow equality checking?](#how-does-react-redux-use-shallow-equality-checking)
- [How does React-Redux use shallow equality checking to determine whether a component needs re-rendering?](#how-does-react-redux-use-shallow-equality-checking-to-determine-whether-a-component-needs-re-rendering)
- [Why will shallow equality checking not work with mutable objects?](#why-will-shallow-equality-checking-not-work-with-mutable-objects)
- [Does shallow equality checking with a mutable object cause problems with Redux?](#does-shallow-equality-checking-with-a-mutable-object-cause-problems-with-redux)
- [Why does a reducer mutating the state prevent React-Redux from re-rendering a wrapped component?](#why-does-a-reducer-mutating-the-state-prevent-react-redux-from-re-rendering-a-wrapped-component)
- [Why does a selector mutating and returning a persistent object to `mapStateToProps` prevent React-Redux from re-rendering a wrapped component?](#why-does-a-selector-mutating-and-returning-a-persistent-object-to-mapstatetoprops-prevent-react-redux-from-re-rendering-a-wrapped-component)
- [How does immutability enable a shallow check to detect object mutations?](#how-does-immutability-enable-a-shallow-check-to-detect-object-mutations)
- [How can immutability in your reducers cause components to render unnecessarily?](#how-can-immutability-in-your-reducers-cause-components-to-render-unnecessarily)
- [How can immutability in mapStateToProps cause components to render unnecessarily?](#how-can-immutability-in-mapstatetoprops-cause-components-to-render-unnecessarily)
- [What approaches are there for handling data immutability? Do I have to use Immer?](#what-approaches-are-there-for-handling-data-immutability-do-i-have-to-use-immer)
- [What are the issues with using JavaScript for immutable operations?](#what-are-the-issues-with-using-plain-javascript-for-immutable-operations)
## Redux FAQ: Immutable Data

## What are the benefits of immutability?

Expand Down
9 changes: 1 addition & 8 deletions docs/faq/Miscellaneous.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,7 @@ title: Miscellaneous
sidebar_label: Miscellaneous
---

# Redux FAQ: Miscellaneous

## Table of Contents

- [Are there any larger, “real” Redux projects?](#are-there-any-larger-real-redux-projects)
- [How can I implement authentication in Redux?](#how-can-i-implement-authentication-in-redux)

## Miscellaneous
## Redux FAQ: Miscellaneous

### Are there any larger, “real” Redux projects?

Expand Down
18 changes: 1 addition & 17 deletions docs/faq/OrganizingState.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,7 @@ title: Organizing State
sidebar_label: Organizing State
---

# Redux FAQ: Organizing State

## Table of Contents

- [Redux FAQ: Organizing State](#redux-faq-organizing-state)
- [Table of Contents](#table-of-contents)
- [Organizing State](#organizing-state)
- [Do I have to put all my state into Redux? Should I ever use React's `useState` or `useReducer`?](#do-i-have-to-put-all-my-state-into-redux-should-i-ever-use-reacts-usestate-or-usereducer)
- [Further information](#further-information)
- [Can I put functions, promises, or other non-serializable items in my store state?](#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)
- [Further information](#further-information-1)
- [How do I organize nested or duplicate data in my state?](#how-do-i-organize-nested-or-duplicate-data-in-my-state)
- [Further information](#further-information-2)
- [Should I put form state or other UI state in my store?](#should-i-put-form-state-or-other-ui-state-in-my-store)
- [Further Information](#further-information-3)

## Organizing State
## Redux FAQ: Organizing State

### Do I have to put all my state into Redux? Should I ever use React's `useState` or `useReducer`?

Expand Down
22 changes: 1 addition & 21 deletions docs/faq/Performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,7 @@ title: Performance
sidebar_label: Performance
---

# Redux FAQ: Performance

## Table of Contents

- [Redux FAQ: Performance](#redux-faq-performance)
- [Table of Contents](#table-of-contents)
- [Performance](#performance)
- [How well does Redux “scale” in terms of performance and architecture?](#how-well-does-redux-scale-in-terms-of-performance-and-architecture)
- [Further information](#further-information)
- [Won't calling “all my reducers” for each action be slow?](#wont-calling-all-my-reducers-for-each-action-be-slow)
- [Further information](#further-information-1)
- [Do I have to deep-clone my state in a reducer? Isn't copying my state going to be slow?](#do-i-have-to-deep-clone-my-state-in-a-reducer-isnt-copying-my-state-going-to-be-slow)
- [Further information](#further-information-2)
- [How can I reduce the number of store update events?](#how-can-i-reduce-the-number-of-store-update-events)
- [Further information](#further-information-3)
- [Will having “one state tree” cause memory problems? Will dispatching many actions take up memory?](#will-having-one-state-tree-cause-memory-problems-will-dispatching-many-actions-take-up-memory)
- [Further information](#further-information-4)
- [Will caching remote data cause memory problems?](#will-caching-remote-data-cause-memory-problems)
- [Further information](#further-information-5)

## Performance
## Redux FAQ: Performance

### How well does Redux “scale” in terms of performance and architecture?

Expand Down
24 changes: 1 addition & 23 deletions docs/faq/ReactRedux.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,7 @@ title: React Redux
sidebar_label: React Redux
---

# Redux FAQ: React Redux

## Table of Contents

- [Redux FAQ: React Redux](#redux-faq-react-redux)
- [Table of Contents](#table-of-contents)
- [React Redux](#react-redux)
- [Why should I use React-Redux?](#why-should-i-use-react-redux)
- [Further Information](#further-information)
- [Why isn't my component re-rendering, or my mapStateToProps running?](#why-isnt-my-component-re-rendering-or-my-mapstatetoprops-running)
- [Further information](#further-information-1)
- [Why is my component re-rendering too often?](#why-is-my-component-re-rendering-too-often)
- [Further information](#further-information-2)
- [How can I speed up my `mapStateToProps`?](#how-can-i-speed-up-my-mapstatetoprops)
- [Further information](#further-information-3)
- [Why don't I have `this.props.dispatch` available in my connected component?](#why-dont-i-have-thispropsdispatch-available-in-my-connected-component)
- [Further information](#further-information-4)
- [Should I only connect my top component, or can I connect multiple components in my tree?](#should-i-only-connect-my-top-component-or-can-i-connect-multiple-components-in-my-tree)
- [Further information](#further-information-5)
- [How does Redux compare to the React Context API?](#how-does-redux-compare-to-the-react-context-api)
- [Further information](#further-information-6)

## React Redux
## Redux FAQ: React Redux

### Why should I use React-Redux?

Expand Down
14 changes: 1 addition & 13 deletions docs/faq/Reducers.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,7 @@ title: Reducers
sidebar_label: Reducers
---

# Redux FAQ: Reducers

## Table of Contents

- [Redux FAQ: Reducers](#redux-faq-reducers)
- [Table of Contents](#table-of-contents)
- [Reducers](#reducers)
- [How do I share state between two reducers? Do I have to use `combineReducers`?](#how-do-i-share-state-between-two-reducers-do-i-have-to-use-combinereducers)
- [Further information](#further-information)
- [Do I have to use the `switch` statement to handle actions?](#do-i-have-to-use-the-switch-statement-to-handle-actions)
- [Further information](#further-information-1)

## Reducers
## Redux FAQ: Reducers

### How do I share state between two reducers? Do I have to use `combineReducers`?

Expand Down
Loading