Skip to content

Commit 111bc38

Browse files
authored
Merge pull request #4788 from reduxjs/docs/dsv3-search-pagefind
Update Docusaurus to v3 and switch search to Canary + Pagefind
2 parents 3040311 + 7826334 commit 111bc38

18 files changed

+3707
-2937
lines changed

docs/FAQ.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ description: 'FAQ Index: Frequently Asked Questions about Redux'
2727
- [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)
2828
- [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)
2929
- **Actions**
30-
- [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)
30+
- [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)
3131
- [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)
3232
- [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)
3333
- [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)
@@ -62,7 +62,7 @@ description: 'FAQ Index: Frequently Asked Questions about Redux'
6262
- [Why isn't my component re-rendering, or my mapStateToProps running?](faq/ReactRedux.md#why-isnt-my-component-re-rendering-or-my-mapstatetoprops-running)
6363
- [Why is my component re-rendering too often?](faq/ReactRedux.md#why-is-my-component-re-rendering-too-often)
6464
- [How can I speed up my mapStateToProps?](faq/ReactRedux.md#how-can-i-speed-up-my-mapstatetoprops)
65-
- [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)
65+
- [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)
6666
- [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)
6767
- **Miscellaneous**
6868
- [Are there any larger, “real” Redux projects?](faq/Miscellaneous.md#are-there-any-larger-real-redux-projects)

docs/api/Store.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ _(any)_: The current state tree of your application.
3232

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

35-
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.
35+
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.
3636

3737
:::caution
3838

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

8484
### subscribe(listener)
8585

86-
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.
86+
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.
8787

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

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

100100
#### Arguments
101101

102-
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.
102+
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.
103103

104104
##### Returns
105105

docs/api/api-reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ See the [**Migrating to Modern Redux** page](../usage/migrating-to-modern-redux.
3939
## Store API
4040

4141
- [Store](Store.md)
42-
- [getState()](Store.md#getState)
42+
- [getState()](Store.md#getstate)
4343
- [dispatch(action)](Store.md#dispatchaction)
4444
- [subscribe(listener)](Store.md#subscribelistener)
4545
- [replaceReducer(nextReducer)](Store.md#replacereducernextreducer)

docs/api/applyMiddleware.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ The original Redux [`createStore`](createStore.md) method does not understand wh
2727

2828
## Arguments
2929

30-
- `...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`.
30+
- `...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`.
3131

3232
### Returns
3333

docs/faq/Actions.md

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,7 @@ title: Actions
44
sidebar_label: Actions
55
---
66

7-
# Redux FAQ: Actions
8-
9-
## Table of Contents
10-
11-
- [Redux FAQ: Actions](#redux-faq-actions)
12-
- [Table of Contents](#table-of-contents)
13-
- [Actions](#actions)
14-
- [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)
15-
- [Further information](#further-information)
16-
- [Is there always a one-to-one mapping between reducers and actions?](#is-there-always-a-one-to-one-mapping-between-reducers-and-actions)
17-
- [Further information](#further-information-1)
18-
- [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)
19-
- [Further information](#further-information-2)
20-
- [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)
21-
- [Should I dispatch multiple actions in a row from one action creator?](#should-i-dispatch-multiple-actions-in-a-row-from-one-action-creator)
22-
- [Further information](#further-information-3)
23-
24-
## Actions
7+
## Redux FAQ: Actions
258

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

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

146129
**Documentation**
147130

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

150133
**Articles**
151134

docs/faq/CodeStructure.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,7 @@ sidebar_label: Code Structure
66

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

9-
# Redux FAQ: Code Structure
10-
11-
## Table of Contents
12-
13-
- [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)
14-
- [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)
15-
- [Why should I use action creators?](#why-should-i-use-action-creators)
16-
- [Where should websockets and other persistent connections live?](#where-should-websockets-and-other-persistent-connections-live)
17-
- [How can I use the Redux store in non-component files?](#how-can-i-use-the-redux-store-in-non-component-files)
9+
## Redux FAQ: Code Structure
1810

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

docs/faq/DesignDecisions.md

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,7 @@ title: Design Decisions
44
sidebar_label: Design Decisions
55
---
66

7-
# Redux FAQ: Design Decisions
8-
9-
## Table of Contents
10-
11-
- [Why doesn't Redux pass the state and action to subscribers?](#why-doesnt-redux-pass-the-state-and-action-to-subscribers)
12-
- [Why doesn't Redux support using classes for actions and reducers?](#why-doesnt-redux-support-using-classes-for-actions-and-reducers)
13-
- [Why does the middleware signature use currying?](#why-does-the-middleware-signature-use-currying)
14-
- [Why does applyMiddleware use a closure for dispatch?](#why-does-applymiddleware-use-a-closure-for-dispatch)
15-
- [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)
16-
- [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)
17-
18-
## Design Decisions
7+
## Redux FAQ: Design Decisions
198

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

docs/faq/ImmutableData.md

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,7 @@ title: Immutable Data
44
sidebar_label: Immutable Data
55
---
66

7-
# Redux FAQ: Immutable Data
8-
9-
## Table of Contents
10-
11-
- [What are the benefits of immutability?](#what-are-the-benefits-of-immutability)
12-
- [Why is immutability required by Redux?](#why-is-immutability-required-by-redux)
13-
- [Why does Redux’s use of shallow equality checking require immutability?](#why-does-reduxs-use-of-shallow-equality-checking-require-immutability)
14-
- [How do Shallow and Deep Equality Checking differ?](#how-do-shallow-and-deep-equality-checking-differ)
15-
- [How does Redux use shallow equality checking?](#how-does-redux-use-shallow-equality-checking)
16-
- [How does `combineReducers` use shallow equality checking?](#how-does-combinereducers-use-shallow-equality-checking)
17-
- [How does React-Redux use shallow equality checking?](#how-does-react-redux-use-shallow-equality-checking)
18-
- [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)
19-
- [Why will shallow equality checking not work with mutable objects?](#why-will-shallow-equality-checking-not-work-with-mutable-objects)
20-
- [Does shallow equality checking with a mutable object cause problems with Redux?](#does-shallow-equality-checking-with-a-mutable-object-cause-problems-with-redux)
21-
- [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)
22-
- [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)
23-
- [How does immutability enable a shallow check to detect object mutations?](#how-does-immutability-enable-a-shallow-check-to-detect-object-mutations)
24-
- [How can immutability in your reducers cause components to render unnecessarily?](#how-can-immutability-in-your-reducers-cause-components-to-render-unnecessarily)
25-
- [How can immutability in mapStateToProps cause components to render unnecessarily?](#how-can-immutability-in-mapstatetoprops-cause-components-to-render-unnecessarily)
26-
- [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)
27-
- [What are the issues with using JavaScript for immutable operations?](#what-are-the-issues-with-using-plain-javascript-for-immutable-operations)
7+
## Redux FAQ: Immutable Data
288

299
## What are the benefits of immutability?
3010

docs/faq/Miscellaneous.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,7 @@ title: Miscellaneous
44
sidebar_label: Miscellaneous
55
---
66

7-
# Redux FAQ: Miscellaneous
8-
9-
## Table of Contents
10-
11-
- [Are there any larger, “real” Redux projects?](#are-there-any-larger-real-redux-projects)
12-
- [How can I implement authentication in Redux?](#how-can-i-implement-authentication-in-redux)
13-
14-
## Miscellaneous
7+
## Redux FAQ: Miscellaneous
158

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

docs/faq/OrganizingState.md

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,7 @@ title: Organizing State
44
sidebar_label: Organizing State
55
---
66

7-
# Redux FAQ: Organizing State
8-
9-
## Table of Contents
10-
11-
- [Redux FAQ: Organizing State](#redux-faq-organizing-state)
12-
- [Table of Contents](#table-of-contents)
13-
- [Organizing State](#organizing-state)
14-
- [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)
15-
- [Further information](#further-information)
16-
- [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)
17-
- [Further information](#further-information-1)
18-
- [How do I organize nested or duplicate data in my state?](#how-do-i-organize-nested-or-duplicate-data-in-my-state)
19-
- [Further information](#further-information-2)
20-
- [Should I put form state or other UI state in my store?](#should-i-put-form-state-or-other-ui-state-in-my-store)
21-
- [Further Information](#further-information-3)
22-
23-
## Organizing State
7+
## Redux FAQ: Organizing State
248

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

docs/faq/Performance.md

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,7 @@ title: Performance
44
sidebar_label: Performance
55
---
66

7-
# Redux FAQ: Performance
8-
9-
## Table of Contents
10-
11-
- [Redux FAQ: Performance](#redux-faq-performance)
12-
- [Table of Contents](#table-of-contents)
13-
- [Performance](#performance)
14-
- [How well does Redux “scale” in terms of performance and architecture?](#how-well-does-redux-scale-in-terms-of-performance-and-architecture)
15-
- [Further information](#further-information)
16-
- [Won't calling “all my reducers” for each action be slow?](#wont-calling-all-my-reducers-for-each-action-be-slow)
17-
- [Further information](#further-information-1)
18-
- [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)
19-
- [Further information](#further-information-2)
20-
- [How can I reduce the number of store update events?](#how-can-i-reduce-the-number-of-store-update-events)
21-
- [Further information](#further-information-3)
22-
- [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)
23-
- [Further information](#further-information-4)
24-
- [Will caching remote data cause memory problems?](#will-caching-remote-data-cause-memory-problems)
25-
- [Further information](#further-information-5)
26-
27-
## Performance
7+
## Redux FAQ: Performance
288

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

docs/faq/ReactRedux.md

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,7 @@ title: React Redux
44
sidebar_label: React Redux
55
---
66

7-
# Redux FAQ: React Redux
8-
9-
## Table of Contents
10-
11-
- [Redux FAQ: React Redux](#redux-faq-react-redux)
12-
- [Table of Contents](#table-of-contents)
13-
- [React Redux](#react-redux)
14-
- [Why should I use React-Redux?](#why-should-i-use-react-redux)
15-
- [Further Information](#further-information)
16-
- [Why isn't my component re-rendering, or my mapStateToProps running?](#why-isnt-my-component-re-rendering-or-my-mapstatetoprops-running)
17-
- [Further information](#further-information-1)
18-
- [Why is my component re-rendering too often?](#why-is-my-component-re-rendering-too-often)
19-
- [Further information](#further-information-2)
20-
- [How can I speed up my `mapStateToProps`?](#how-can-i-speed-up-my-mapstatetoprops)
21-
- [Further information](#further-information-3)
22-
- [Why don't I have `this.props.dispatch` available in my connected component?](#why-dont-i-have-thispropsdispatch-available-in-my-connected-component)
23-
- [Further information](#further-information-4)
24-
- [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)
25-
- [Further information](#further-information-5)
26-
- [How does Redux compare to the React Context API?](#how-does-redux-compare-to-the-react-context-api)
27-
- [Further information](#further-information-6)
28-
29-
## React Redux
7+
## Redux FAQ: React Redux
308

319
### Why should I use React-Redux?
3210

docs/faq/Reducers.md

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,7 @@ title: Reducers
44
sidebar_label: Reducers
55
---
66

7-
# Redux FAQ: Reducers
8-
9-
## Table of Contents
10-
11-
- [Redux FAQ: Reducers](#redux-faq-reducers)
12-
- [Table of Contents](#table-of-contents)
13-
- [Reducers](#reducers)
14-
- [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)
15-
- [Further information](#further-information)
16-
- [Do I have to use the `switch` statement to handle actions?](#do-i-have-to-use-the-switch-statement-to-handle-actions)
17-
- [Further information](#further-information-1)
18-
19-
## Reducers
7+
## Redux FAQ: Reducers
208

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

0 commit comments

Comments
 (0)