React Native | Tutorial Suspense | Data Fetching | SWR
Beto, April 9, 2022 · 2,754 views
Manually tracking in every component gets old fast. With React 18's Suspense and SWR, your components just render data and React handles the waiting: one fallback UI, zero loading booleans. In the video I build a React Native app that fetches random users from an API and renders them as cards, with Suspense showing the placeholder until everything is ready.
What's inside
- Upgrade an Expo project to React 18 for Suspense support
- Configure SWR globally with a fetcher and
- Wrap your data-fetching UI in with a fallback
- Build a reusable Card component for user data
- Fetch and render a list of users from a free API
- Ship components with no manual loading state logic at all
Resources

CourseReact Native course
17 sections and 800+ minutes, from fundamentals to shipping on the stores.
Had a win? Get featured on Code with Beto.Share your story
Like this article? Get the rest of the library plus weekly React Native tips. Free.