Weather Dashboard — Build Mini React Weather App

Custom Hooks — Intermediate React challenge.

Build a weather search dashboard from scratch: a city input, a mocked async fetch, and full loading/success/error state handling with retry — no libraries, no pre-built markup.

Requirements

Signature

function WeatherDashboard({ fetchWeather: (city: string) => Promise<{city, temperature, condition}> }): JSX.Element

Example

<WeatherDashboard fetchWeather={fetchWeather} />
// type "London" -> click Search -> loading -> weather card with 18°C, Cloudy
// type "Atlantis" -> error "City not found" + Retry button

Constraints

🏷️ Get 20% OFF on Yearly & Lifetime plans — use code 🏷️ Get 20% OFF on Yearly & Lifetime plans — use code 🏷️ Get 20% OFF on Yearly & Lifetime plans — use code 🏷️ Get 20% OFF on Yearly & Lifetime plans — use code 🏷️ Get 20% OFF on Yearly & Lifetime plans — use code 🏷️ Get 20% OFF on Yearly & Lifetime plans — use code
Loading workspace…