From 985777a1e95426f22c58ec0861c54aa68787d98e Mon Sep 17 00:00:00 2001 From: Kaan Barmore-Genc Date: Sun, 18 Sep 2022 22:01:21 -0400 Subject: [PATCH] Typo --- ....09.18.solving-react-redux-triggering-too-many-re-renders.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/posts/2022.09.18.solving-react-redux-triggering-too-many-re-renders.md b/content/posts/2022.09.18.solving-react-redux-triggering-too-many-re-renders.md index 2a52748..b933509 100644 --- a/content/posts/2022.09.18.solving-react-redux-triggering-too-many-re-renders.md +++ b/content/posts/2022.09.18.solving-react-redux-triggering-too-many-re-renders.md @@ -81,7 +81,7 @@ using the `pick` function to extract values out of an object. React Redux checks if the value selected by the selector has changed to decide if things need to be re-rendered, but it uses a basic equality comparison and not a deep equality check. Because `pick` keeps creating new objects, the objects are never equal to -each other, and Redux keeps thinking that it has to re-render my object! +each other, and Redux keeps thinking that it has to re-render everything! The solution luckily is easy, we can tell redux to use a custom function for comparison. I used a `shallowEquals` function to do a single-depth comparison of