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 show you why you shouldn’t do it directly.

cff75c5fca39bbcc.png

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.

Leave a Comment