Part of the class components to function components series. In earlier versions of React, one of the biggest downsides to using function components over class components was that you could not use life cycle methods. What if you need to do something when your component mounts, like fetch some data or set some initial state? […]
There are situations where you do want to share state between multiple components, and you may not want to bring Redux into your architecture. In this tutorial, you’ll learn how to create your own mini-state management system.
If you are using class components, but want to use hooks, you can’t do so directly. One strategy for adding them is to use adapter components. Another strategy is to use higher-order components to pass along data from hooks as props. Here’s how
When the react-redux team released version 7.1.0, they added hooks to react-redux! Here’s a quick comparison of how it could change how you write components. First, a brief overview of the new toys useSelector: Pass in a function that takes the state as an argument and returns a value. Used to get a single value […]