📄️ Local State Vs Global State
There are two kinds of state in React
📄️ React Context is Dangerous
Context is not a replacement for global state. It can cause visible performance problems.
📄️ Decouple UI from State
When it comes to global state management in react, there's no opinionated solution on the topic. But currently redux is by far the most popular library. How we use redux in our react applications has gone through many changes and evolved over the past few years.
📄️ APIs and Caching
Caching API calls is important for performance and user experience. For example, if you fetch data in TABA, switch to TABB to fetch different data, and then quickly return to TAB_A, you typically don't need to refetch the data again if it hasn't changed. Instead, reuse the cached data and render the content. If necessary, refetch it in the background and only update the UI if the data has changed; otherwise, continue displaying the cached data.