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)