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