React
Fondamental
Fetching data with useEffect and displaying it
Type d'évaluation
Mise en situation réelle
Analyse
Intelligence Artificielle
Compétences ciblées
react
useeffect
fetch
api
loading
Scénario Technique
Context A team wants to display a list of users fetched from a public API on component mount. The Problem The data fetch is currently triggered on a button click inside an event handler, causing data to not appear on initial load. Constraints Use useEffect with an empty dependency array to fetch data on mount. Store the result in state with useState. Display a loading indicator while fetching. Expected Deliverable A React component that fetches data from a REST API on mount using useEffect, manages loading state, and renders the results.
Prêt à évaluer ce talent ?
Accédez à l'interface de test complète pour soumettre votre architecture ou votre code.