Although I have been using Redux to handle data fetching in many of my projects, I’ve always believed there must be a better way to do the same with React JS.
Fetching data in Redux is a quite verbose process. Each fetch operation requires the developer to create:
Writing all this code takes a lot of time, even for a simple API call. Moreover, it’s not hard to end up with a big JS bundle.
👎 Over usage of Redux…
A common mistake is to believe that a React component is smart enough to understand whether it needs to render itself again or not, based on its own
state. But that’s not entirely the truth.
To better understand why, we should start by learning about the limitations of a non-pure React component by looking at two examples. After that, it will be easier to grasp the benefits of
React.memo() by looking at two other examples.
A short summary of what’s coming:
Software developer, passionate photographer, design lover and tireless dreamer