From 0846e26c200705689e51aad6a743504ed74c0219 Mon Sep 17 00:00:00 2001 From: "REDMOND\\jspurlin" Date: Thu, 25 Aug 2022 12:53:15 -0700 Subject: [PATCH] update connect docs --- docs/api/connect.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/api/connect.md b/docs/api/connect.md index 2b87d6b6c..112b728ce 100644 --- a/docs/api/connect.md +++ b/docs/api/connect.md @@ -233,7 +233,7 @@ connect(mapStateToProps, mapDispatchToProps, null, { context: MyContext })( ) ``` -#### `areStatesEqual: (next: Object, prev: Object) => boolean` +#### `areStatesEqual: (next: Object, prev: Object, nextOwnProps: Object, prevOwnProps: Object) => boolean` - default value: `strictEqual: (next, prev) => prev === next` @@ -244,7 +244,7 @@ const areStatesEqual = (next, prev) => prev.entities.todos === next.entities.todos ``` -You may wish to override `areStatesEqual` if your `mapStateToProps` function is computationally expensive and is also only concerned with a small slice of your state. The example above will effectively ignore state changes for everything but that slice of state. +You may wish to override `areStatesEqual` if your `mapStateToProps` function is computationally expensive and is also only concerned with a small slice of your state. The example above will effectively ignore state changes for everything but that slice of state. Additionally, `areStatesEqual` provides `nextOwnProps` and `prevOwnProps` to allow for more effective scoping of your state which your connected component is interested in, if needed. This would likely impact the other equality checks as well, depending on your `mapStateToProps` function.