Our latest React Challenge is live, and itβs all about taking your data fetching skills to the next level!
In this challenge, you'll replace the traditional useState/useEffect flow with the new Suspense-driven use() approachβall while keeping the same UI behavior.
π§© Overview
Build a simple React page that fetches Rick and Morty characters using use(). The goal is to make your data flow more declarative, cleaner, and easier to maintain.
Youβll keep the same skeleton loading UI and character cards, but under the hood, your components will suspend until the data is ready.
β Requirements
- Fetch the character list from
https://rickandmortyapi.com/api/character/. - Use React Suspense with
use()to read a stable promise (nouseEffect+useStatefetching). - Display the provided skeleton UI while data is pending.
- Render character cards after the data resolves.
- Maintain the existing layout and styling.
π‘ Notes
- Create the fetch promise outside the component so it remains stable across renders.
- Use
CharactersSkeletonas the Suspense fallback. - Simulated latency is optionalβyou can remove it or adjust its duration without affecting the tests.
-
Important: Tests will fail if you use
useEffect; the focus is onuse().
π§ͺ Tests
- Renders the app title
- Shows skeleton while loading
- Renders characters after loading
- Uses React
use()instead ofuseEffect
This challenge is perfect for developers who want to modernize their React data fetching and get hands-on experience with suspense-first rendering.
Top comments (0)