mediumReact Native#14

React Query fetch and cache

Prompt

Use React Query (@tanstack/react-query) to fetch user data from a mock API. Show a loading indicator while fetching, the user name on success, and an error message on failure.

Hints

Solution

Your Code

10 min

Tests

Click Run to test your code