React's useState and useEffect hooks were a godsend for the React community. However, like any tool, these can easily be abused. The problem with the above use case is that we are keeping track of some redundant state, specifically items and itemsLength. These pieces of data can instead be derived functionally from data.
1 Comment
Sort: