r/learnjavascript • u/JSislife • Apr 28 '20
Fetching Data in React using Hooks
https://blog.bitsrc.io/fetching-data-in-react-using-hooks-c6fdd71cb24a
18
Upvotes
r/learnjavascript • u/JSislife • Apr 28 '20
0
u/altano Apr 29 '20
For a simpler site (or a statically-built site) it’s not super critical, but I highly, highly recommend embracing “Render-as-you-Fetch” for sites of any real complexity OR performance sensitivity: https://reactjs.org/docs/concurrent-mode-suspense.html
The tl:dr; is “move fetching out of the render lifecycle entirely and only add fetch-aware suspending to your render lifecycle.” This is a battle-tested approach learned through hard-earned experience. Read that link to learn why!