The Best Way to Fetch Data from an API in React - SWR Preload & Optimistic UI

The Best Way to Fetch Data from an API in React - SWR Preload & Optimistic UI

Dave Gray via YouTube Direct link

Intro

1 of 22

1 of 22

Intro

Class Central Classrooms beta

YouTube playlists curated by Class Central.

Classroom Contents

The Best Way to Fetch Data from an API in React - SWR Preload & Optimistic UI

Automatically move to the next video in the Classroom when playback concludes

  1. 1 Intro
  2. 2 Welcome
  3. 3 SWR Explained
  4. 4 Starter Code
  5. 5 Install SWR
  6. 6 json-server
  7. 7 Axios API layer
  8. 8 Imports
  9. 9 useSWR hook
  10. 10 SWR mutate function
  11. 11 What is a mutation?
  12. 12 Check the CRUD operations
  13. 13 Adding some delay
  14. 14 Viewing stale data until success or fail
  15. 15 SWR 2.0 Preload data
  16. 16 Benefits of Optimistic UI updates
  17. 17 Refactor to Optimistic UI
  18. 18 Helper functions
  19. 19 Import the helpers
  20. 20 Mutate with Optimistic UI
  21. 21 Checking the Optimistic UI
  22. 22 A Challenge for You

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.