Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: reduxjs/react-redux
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v7.2.1
Choose a base ref
...
head repository: reduxjs/react-redux
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v7.2.2
Choose a head ref
  • 16 commits
  • 119 files changed
  • 11 contributors

Commits on Aug 5, 2020

  1. fix mapDispatchToProps ownProps example description (#1621)

    Co-authored-by: sagiv.bengiat <sagiv.bengiat@appsflyer.com>
    sag1v and sagiv.bengiat authored Aug 5, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    f08b644 View commit details

Commits on Aug 6, 2020

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    681cc47 View commit details

Commits on Aug 8, 2020

  1. Bump prismjs from 1.15.0 to 1.21.0 in /website (#1623)

    Bumps [prismjs](https://github.com/PrismJS/prism) from 1.15.0 to 1.21.0.
    - [Release notes](https://github.com/PrismJS/prism/releases)
    - [Changelog](https://github.com/PrismJS/prism/blob/master/CHANGELOG.md)
    - [Commits](PrismJS/prism@v1.15.0...v1.21.0)
    
    Signed-off-by: dependabot[bot] <support@github.com>
    
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Aug 8, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    f0124d7 View commit details

Commits on Aug 29, 2020

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    4c907c0 View commit details

Commits on Sep 4, 2020

  1. Bump lodash.merge from 4.6.1 to 4.6.2 in /website (#1627)

    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Sep 4, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    7fe00f1 View commit details

Commits on Sep 6, 2020

  1. Bump @hapi/hoek from 8.5.0 to 8.5.1 (#1628)

    Bumps [@hapi/hoek](https://github.com/hapijs/hoek) from 8.5.0 to 8.5.1.
    - [Release notes](https://github.com/hapijs/hoek/releases)
    - [Commits](hapijs/hoek@v8.5.0...v8.5.1)
    
    Signed-off-by: dependabot[bot] <support@github.com>
    
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Sep 6, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    90795b6 View commit details

Commits on Oct 14, 2020

  1. Update docusaurus (#1638)

    josephMG authored Oct 14, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    e9094e7 View commit details

Commits on Oct 21, 2020

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    32c5216 View commit details

Commits on Oct 22, 2020

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    c4d81af View commit details

Commits on Oct 23, 2020

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    7eee197 View commit details

Commits on Oct 26, 2020

  1. Update deps.

    Prettier formatting, TLR changes, small lint name change, Rollup 2 updates.
    timdorr committed Oct 26, 2020

    Verified

    This commit was signed with the committer’s verified signature.
    timdorr Tim Dorr
    Copy the full SHA
    754c105 View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    e00d63c View commit details
  3. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    52fdba2 View commit details
  4. Stop using Travis

    They're having backlog problems and Actions are better integrated into the GH interface.
    timdorr authored Oct 26, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    3a3dd04 View commit details
  5. Use a newer node

    timdorr authored Oct 26, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    8010d86 View commit details
  6. 7.2.2

    timdorr committed Oct 26, 2020

    Verified

    This commit was signed with the committer’s verified signature.
    timdorr Tim Dorr
    Copy the full SHA
    1df5622 View commit details
Showing with 35,586 additions and 15,642 deletions.
  1. +2 −1 .github/workflows/{main.yaml → size.yaml}
  2. +40 −0 .github/workflows/test.yml
  3. +0 −7 .travis.yml
  4. +1 −1 docs/api/batch.md
  5. +1 −1 docs/api/connect-advanced.md
  6. +33 −81 docs/api/connect.md
  7. +16 −16 docs/api/hooks.md
  8. +19 −37 docs/introduction/basic-tutorial.md
  9. +3 −6 docs/introduction/quick-start.md
  10. +3 −8 docs/troubleshooting.md
  11. +24 −36 docs/using-react-redux/connect-dispatching-actions-with-mapDispatchToProps.md
  12. +5 −5 docs/using-react-redux/connect-extracting-data-with-mapStateToProps.md
  13. +232 −0 docs/using-react-redux/static-types.md
  14. +16,584 −6,851 package-lock.json
  15. +43 −43 package.json
  16. +12 −20 rollup.config.js
  17. +1 −1 src/alternate-renderers.js
  18. +3 −3 src/components/Provider.js
  19. +11 −11 src/components/connectAdvanced.js
  20. +3 −3 src/connect/connect.js
  21. +3 −3 src/connect/mapDispatchToProps.js
  22. +2 −2 src/hooks/useSelector.js
  23. +1 −1 src/index.js
  24. +2 −2 src/utils/Subscription.js
  25. +1 −1 src/utils/batch.js
  26. +17 −17 src/utils/isPlainObject.js
  27. +1 −1 src/utils/reactBatchedUpdates.native.js
  28. +1 −1 src/utils/wrapActionCreators.js
  29. +11 −8 test/components/Provider.spec.js
  30. +229 −315 test/components/connect.spec.js
  31. +194 −194 test/components/connectAdvanced.spec.js
  32. +8 −8 test/components/hooks.spec.js
  33. +6 −6 test/hooks/useDispatch.spec.js
  34. +26 −26 test/hooks/useSelector.spec.js
  35. +9 −9 test/integration/dynamic-reducers.spec.js
  36. +2 −2 test/integration/server-rendering.spec.js
  37. +25 −22 test/react-native/batch-integration.js
  38. +22 −22 test/utils/isPlainObject.spec.js
  39. +5 −5 test/utils/shallowEqual.spec.js
  40. +2 −2 test/utils/wrapActionCreators.spec.js
  41. +0 −116 website/core/Footer.js
  42. +199 −0 website/docusaurus.config.js
  43. +13,674 −6,981 website/package-lock.json
  44. +12 −7 website/package.json
  45. +0 −42 website/pages/en/404.js
  46. +0 −220 website/pages/en/index.js
  47. +0 −116 website/siteConfig.js
  48. 0 website/{pages/en/versions.js → src/pages/_versions.js}
  49. +212 −0 website/src/pages/index.js
  50. +89 −0 website/src/pages/styles.module.css
  51. +54 −0 website/src/theme/NotFound.js
  52. +3 −4 website/static/css/404.css
  53. +129 −209 website/static/css/custom.css
  54. BIN website/static/img/redux-logo-landscape.png
  55. +62 −0 website/static/scripts/monokaiTheme.js
  56. +1 −2 website/versioned_docs/version-5.x/api.md
  57. +1 −2 website/versioned_docs/version-5.x/api/Provider.md
  58. +1 −2 website/versioned_docs/version-5.x/api/api.md
  59. +1 −2 website/versioned_docs/version-5.x/api/connect-advanced.md
  60. +1 −2 website/versioned_docs/version-5.x/api/connect.md
  61. +2 −3 website/versioned_docs/version-5.x/introduction/basic-tutorial.md
  62. +1 −2 website/versioned_docs/version-5.x/introduction/quick-start.md
  63. +1 −2 website/versioned_docs/version-5.x/introduction/why-use-react-redux.md
  64. +1 −2 website/versioned_docs/version-5.x/troubleshooting.md
  65. +3 −4 ...rsioned_docs/version-5.x/using-react-redux/connect-dispatching-actions-with-mapDispatchToProps.md
  66. +7 −8 website/versioned_docs/version-5.x/using-react-redux/connect-extracting-data-with-mapStateToProps.md
  67. +1 −2 website/versioned_docs/version-6.x/api/Provider.md
  68. +1 −2 website/versioned_docs/version-6.x/api/connect-advanced.md
  69. +1 −2 website/versioned_docs/version-6.x/api/connect.md
  70. +1 −2 website/versioned_docs/version-6.x/introduction/basic-tutorial.md
  71. +2 −3 website/versioned_docs/version-6.x/introduction/quick-start.md
  72. +1 −2 website/versioned_docs/version-6.x/introduction/why-use-react-redux.md
  73. +1 −2 website/versioned_docs/version-6.x/troubleshooting.md
  74. +1 −2 website/versioned_docs/version-6.x/using-react-redux/accessing-store.md
  75. +3 −4 ...rsioned_docs/version-6.x/using-react-redux/connect-dispatching-actions-with-mapDispatchToProps.md
  76. +7 −8 website/versioned_docs/version-6.x/using-react-redux/connect-extracting-data-with-mapStateToProps.md
  77. +100 −0 website/versioned_docs/version-7.0/api/Provider.md
  78. +2 −3 website/versioned_docs/version-7.0/api/batch.md
  79. +86 −0 website/versioned_docs/version-7.0/api/connect-advanced.md
  80. +1 −2 website/versioned_docs/version-7.0/api/connect.md
  81. +458 −0 website/versioned_docs/version-7.0/introduction/basic-tutorial.md
  82. +2 −3 website/versioned_docs/version-7.0/introduction/quick-start.md
  83. +90 −0 website/versioned_docs/version-7.0/introduction/why-use-react-redux.md
  84. +94 −0 website/versioned_docs/version-7.0/troubleshooting.md
  85. +1 −2 website/versioned_docs/version-7.0/using-react-redux/accessing-store.md
  86. +409 −0 ...rsioned_docs/version-7.0/using-react-redux/connect-dispatching-actions-with-mapDispatchToProps.md
  87. +228 −0 website/versioned_docs/version-7.0/using-react-redux/connect-extracting-data-with-mapStateToProps.md
  88. +100 −0 website/versioned_docs/version-7.1/api/Provider.md
  89. +1 −2 website/versioned_docs/version-7.1/api/batch.md
  90. +86 −0 website/versioned_docs/version-7.1/api/connect-advanced.md
  91. +1 −2 website/versioned_docs/version-7.1/api/connect.md
  92. +2 −3 website/versioned_docs/version-7.1/api/hooks.md
  93. +458 −0 website/versioned_docs/version-7.1/introduction/basic-tutorial.md
  94. +2 −3 website/versioned_docs/version-7.1/introduction/quick-start.md
  95. +1 −2 website/versioned_docs/version-7.1/introduction/why-use-react-redux.md
  96. +94 −0 website/versioned_docs/version-7.1/troubleshooting.md
  97. +144 −0 website/versioned_docs/version-7.1/using-react-redux/accessing-store.md
  98. +409 −0 ...rsioned_docs/version-7.1/using-react-redux/connect-dispatching-actions-with-mapDispatchToProps.md
  99. +228 −0 website/versioned_docs/version-7.1/using-react-redux/connect-extracting-data-with-mapStateToProps.md
  100. +1 −2 website/versioned_docs/version-7.1/using-react-redux/static-types.md
  101. BIN website/versioned_docs/version-7.2/api/.DS_Store
  102. +100 −0 website/versioned_docs/version-7.2/api/Provider.md
  103. +1 −2 website/versioned_docs/version-7.2/api/batch.md
  104. +86 −0 website/versioned_docs/version-7.2/api/connect-advanced.md
  105. +1 −2 website/versioned_docs/version-7.2/api/connect.md
  106. +2 −3 website/versioned_docs/version-7.2/api/hooks.md
  107. +1 −2 website/versioned_docs/version-7.2/introduction/basic-tutorial.md
  108. +2 −3 website/versioned_docs/version-7.2/introduction/quick-start.md
  109. +1 −2 website/versioned_docs/version-7.2/introduction/why-use-react-redux.md
  110. +1 −2 website/versioned_docs/version-7.2/troubleshooting.md
  111. +1 −2 website/versioned_docs/version-7.2/using-react-redux/accessing-store.md
  112. +4 −5 ...rsioned_docs/version-7.2/using-react-redux/connect-dispatching-actions-with-mapDispatchToProps.md
  113. +13 −14 website/versioned_docs/version-7.2/using-react-redux/connect-extracting-data-with-mapStateToProps.md
  114. +228 −0 website/versioned_docs/version-7.2/using-react-redux/static-types.md
  115. +11 −11 website/versioned_sidebars/version-5.x-sidebars.json
  116. +11 −11 website/versioned_sidebars/version-6.x-sidebars.json
  117. +12 −12 website/versioned_sidebars/version-7.0-sidebars.json
  118. +14 −14 website/versioned_sidebars/version-7.1-sidebars.json
  119. +23 −0 website/versioned_sidebars/version-7.2-sidebars.json
3 changes: 2 additions & 1 deletion .github/workflows/main.yaml → .github/workflows/size.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
name: Compressed Size
name: Bundle Size

on: [pull_request]

jobs:
build:
name: Check compressed size
runs-on: ubuntu-latest

steps:
40 changes: 40 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Tests

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:
name: Test Suite
runs-on: ubuntu-latest

steps:

- name: Set up Node
uses: actions/setup-node@v1
with:
node-version: 14.x

- name: Checkout code
uses: actions/checkout@v2

- name: Cache dependencies
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.OS }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-npm-
${{ runner.OS }}-
- name: Install dependencies
run: npm ci

- name: Run test suite
run: npm test

- name: Collect coverage
run: npm run coverage
7 changes: 0 additions & 7 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion docs/api/batch.md
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ hide_title: true
# `batch()`

```js
batch(fn: Function)
batch((fn: Function))
```

React's `unstable_batchedUpdates()` API allows any React updates in an event loop tick to be batched together into a single render pass. React already uses this internally for its own event handler callbacks. This API is actually part of the renderer packages like ReactDOM and React Native, not the React core itself.
2 changes: 1 addition & 1 deletion docs/api/connect-advanced.md
Original file line number Diff line number Diff line change
@@ -72,7 +72,7 @@ function selectorFactory(dispatch) {
let result = {}

const actions = bindActionCreators(actionCreators, dispatch)
const addTodo = text => actions.addTodo(ownProps.userId, text)
const addTodo = (text) => actions.addTodo(ownProps.userId, text)

return (nextState, nextOwnProps) => {
const todos = nextState.todos[nextOwnProps.userId]
114 changes: 33 additions & 81 deletions docs/api/connect.md
Original file line number Diff line number Diff line change
@@ -48,7 +48,7 @@ A `mapStateToProps` function takes a maximum of two parameters. The number of de
If your `mapStateToProps` function is declared as taking one parameter, it will be called whenever the store state changes, and given the store state as the only parameter.
```js
const mapStateToProps = state => ({ todos: state.todos })
const mapStateToProps = (state) => ({ todos: state.todos })
```
##### `ownProps`
@@ -59,7 +59,7 @@ The second parameter is normally referred to as `ownProps` by convention.
```js
const mapStateToProps = (state, ownProps) => ({
todo: state.todos[ownProps.id]
todo: state.todos[ownProps.id],
})
```
@@ -83,12 +83,7 @@ Your component will receive `dispatch` by default, i.e., when you do not supply
// do not pass `mapDispatchToProps`
connect()(MyComponent)
connect(mapState)(MyComponent)
connect(
mapState,
null,
mergeProps,
options
)(MyComponent)
connect(mapState, null, mergeProps, options)(MyComponent)
```
If you define a `mapDispatchToProps` as a function, it will be called with a maximum of two parameters.
@@ -103,12 +98,12 @@ If you define a `mapDispatchToProps` as a function, it will be called with a max
If your `mapDispatchToProps` is declared as a function taking one parameter, it will be given the `dispatch` of your `store`.
```js
const mapDispatchToProps = dispatch => {
const mapDispatchToProps = (dispatch) => {
return {
// dispatching plain actions
increment: () => dispatch({ type: 'INCREMENT' }),
decrement: () => dispatch({ type: 'DECREMENT' }),
reset: () => dispatch({ type: 'RESET' })
reset: () => dispatch({ type: 'RESET' }),
}
}
```
@@ -121,11 +116,11 @@ The second parameter is normally referred to as `ownProps` by convention.
```js
// binds on component re-rendering
<button onClick={() => this.props.toggleTodo(this.props.todoId)} />
;<button onClick={() => this.props.toggleTodo(this.props.todoId)} />

// binds on `props` change
const mapDispatchToProps = (dispatch, ownProps) => ({
toggleTodo: () => dispatch(toggleTodo(ownProps.todoId))
toggleTodo: () => dispatch(toggleTodo(ownProps.todoId)),
})
```
@@ -146,7 +141,7 @@ const mapDispatchToProps = (dispatch, ownProps) => {
dispatchActionCreatedByActionCreator: () => dispatch(createMyAction()),
...boundActions,
// you may return dispatch here
dispatch
dispatch,
}
}
```
@@ -165,13 +160,10 @@ import { addTodo, deleteTodo, toggleTodo } from './actionCreators'
const mapDispatchToProps = {
addTodo,
deleteTodo,
toggleTodo
toggleTodo,
}

export default connect(
null,
mapDispatchToProps
)(TodoApp)
export default connect(null, mapDispatchToProps)(TodoApp)
```
In this case, React-Redux binds the `dispatch` of your store to each of the action creators using `bindActionCreators`. The result will be regarded as `dispatchProps`, which will be either directly merged to your connected components, or supplied to `mergeProps` as the second argument.
@@ -226,12 +218,9 @@ You may pass the context to your connected component either by passing it here a
```js
// const MyContext = React.createContext();
connect(
mapStateToProps,
mapDispatchToProps,
null,
{ context: MyContext }
)(MyComponent)
connect(mapStateToProps, mapDispatchToProps, null, { context: MyContext })(
MyComponent
)
```
#### `pure: boolean`
@@ -308,14 +297,11 @@ The return of `connect()` is a wrapper function that takes your component and re
```js
import { login, logout } from './actionCreators'

const mapState = state => state.user
const mapState = (state) => state.user
const mapDispatch = { login, logout }

// first call: returns a hoc that you can use to wrap any component
const connectUser = connect(
mapState,
mapDispatch
)
const connectUser = connect(mapState, mapDispatch)

// second call: returns the wrapper component with mergedProps
// you may use the hoc to enable different components to get the same behavior
@@ -328,16 +314,13 @@ In most cases, the wrapper function will be called right away, without being sav
```js
import { login, logout } from './actionCreators'

const mapState = state => state.user
const mapState = (state) => state.user
const mapDispatch = { login, logout }

// call connect to generate the wrapper function, and immediately call
// the wrapper function to generate the final wrapper component.

export default connect(
mapState,
mapDispatch
)(Login)
export default connect(mapState, mapDispatch)(Login)
```
## Example Usage
@@ -355,10 +338,7 @@ export default connect()(TodoApp)
```js
import * as actionCreators from './actionCreators'

export default connect(
null,
actionCreators
)(TodoApp)
export default connect(null, actionCreators)(TodoApp)
```
- Inject `dispatch` and every field in the global state
@@ -368,7 +348,7 @@ export default connect(
```js
// don't do this!
export default connect(state => state)(TodoApp)
export default connect((state) => state)(TodoApp)
```
- Inject `dispatch` and `todos`
@@ -390,10 +370,7 @@ function mapStateToProps(state) {
return { todos: state.todos }
}

export default connect(
mapStateToProps,
actionCreators
)(TodoApp)
export default connect(mapStateToProps, actionCreators)(TodoApp)
```
- Inject `todos` and all action creators (`addTodo`, `completeTodo`, ...) as `actions`
@@ -410,10 +387,7 @@ function mapDispatchToProps(dispatch) {
return { actions: bindActionCreators(actionCreators, dispatch) }
}

export default connect(
mapStateToProps,
mapDispatchToProps
)(TodoApp)
export default connect(mapStateToProps, mapDispatchToProps)(TodoApp)
```
- Inject `todos` and a specific action creator (`addTodo`)
@@ -430,10 +404,7 @@ function mapDispatchToProps(dispatch) {
return bindActionCreators({ addTodo }, dispatch)
}

export default connect(
mapStateToProps,
mapDispatchToProps
)(TodoApp)
export default connect(mapStateToProps, mapDispatchToProps)(TodoApp)
```
- Inject `todos` and specific action creators (`addTodo` and `deleteTodo`) with shorthand syntax
@@ -447,13 +418,10 @@ function mapStateToProps(state) {

const mapDispatchToProps = {
addTodo,
deleteTodo
deleteTodo,
}

export default connect(
mapStateToProps,
mapDispatchToProps
)(TodoApp)
export default connect(mapStateToProps, mapDispatchToProps)(TodoApp)
```
- Inject `todos`, `todoActionCreators` as `todoActions`, and `counterActionCreators` as `counterActions`
@@ -470,14 +438,11 @@ function mapStateToProps(state) {
function mapDispatchToProps(dispatch) {
return {
todoActions: bindActionCreators(todoActionCreators, dispatch),
counterActions: bindActionCreators(counterActionCreators, dispatch)
counterActions: bindActionCreators(counterActionCreators, dispatch),
}
}

export default connect(
mapStateToProps,
mapDispatchToProps
)(TodoApp)
export default connect(mapStateToProps, mapDispatchToProps)(TodoApp)
```
- Inject `todos`, and todoActionCreators and counterActionCreators together as `actions`
@@ -496,14 +461,11 @@ function mapDispatchToProps(dispatch) {
actions: bindActionCreators(
{ ...todoActionCreators, ...counterActionCreators },
dispatch
)
),
}
}

export default connect(
mapStateToProps,
mapDispatchToProps
)(TodoApp)
export default connect(mapStateToProps, mapDispatchToProps)(TodoApp)
```
- Inject `todos`, and all `todoActionCreators` and `counterActionCreators` directly as props
@@ -524,10 +486,7 @@ function mapDispatchToProps(dispatch) {
)
}

export default connect(
mapStateToProps,
mapDispatchToProps
)(TodoApp)
export default connect(mapStateToProps, mapDispatchToProps)(TodoApp)
```
- Inject `todos` of a specific user depending on props
@@ -554,15 +513,11 @@ function mapStateToProps(state) {
function mergeProps(stateProps, dispatchProps, ownProps) {
return Object.assign({}, ownProps, {
todos: stateProps.todos[ownProps.userId],
addTodo: text => dispatchProps.addTodo(ownProps.userId, text)
addTodo: (text) => dispatchProps.addTodo(ownProps.userId, text),
})
}

export default connect(
mapStateToProps,
actionCreators,
mergeProps
)(TodoApp)
export default connect(mapStateToProps, actionCreators, mergeProps)(TodoApp)
```
## Notes
@@ -612,11 +567,8 @@ The factory functions are commonly used with memoized selectors. This gives you
```js
const makeUniqueSelectorInstance = () =>
createSelector(
[selectItems, selectItemId],
(items, itemId) => items[itemId]
)
const makeMapState = state => {
createSelector([selectItems, selectItemId], (items, itemId) => items[itemId])
const makeMapState = (state) => {
const selectItemForThisComponent = makeUniqueSelectorInstance()
return function realMapState(state, ownProps) {
const item = selectItemForThisComponent(state, ownProps.itemId)
Loading