1
2
3
4
5
6
Use the "Verify Solution" button to get AI feedback on your React code.
Your task is to complete a React component that fetches a list of users from a public API using react-query. The component should display a loading indicator while data is being fetched and show an error message if the fetch fails. Finally, it should render the list of user names once the data is successfully loaded.
API Endpoint: https://jsonplaceholder.typicode.com/users