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.

2m read timeFrom dev.to
Post cover image
Table of contents
A Better Way:Takeawaystl;dr:
1 Comment

Sort: