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 show you why you shouldn’t do it directly.
Read the full article at https://blog.skk.moe/post/why-you-should-not-fetch-data-directly-in-use-effect/
This article is reprinted from: https://blog.skk.moe/post/why-you-should-not-fetch-data-directly-in-use-effect/
This site is for inclusion only, and the copyright belongs to the original author.