Sukka’s Blog

Why does React re-render

Original link: https://blog.skk.moe/post/react-re-renders-101/ Updating (re-rendering) is an important feature of React – when the user interacts with the application, React needs to re-render and update the UI in response to user input. But why does React re-render? Without knowing why React re-renders, how can we avoid additional re-renders? Read the full article at https://blog.skk.moe/post/react-re-renders-101/ This […]

Why does React re-render Read More »

Why you shouldn’t use useEffect directly in React to get data from an API

Original link: https://blog.skk.moe/post/why-you-should-not-fetch-data-directly-in-use-effect/ React is a JavaScript library open sourced by Facebook for building UIs on any platform. In React, a common pattern is to use useEffect with useState to send requests, to synchronize state from an API (outside of React) to inside of React, and to render the UI. This article is just to

Why you shouldn’t use useEffect directly in React to get data from an API Read More »