A weather forecast site is built using React TypeScript.
The src directory looks like this:
src
βββ client
β βββ App.tsx
β βββ components
β β βββ AddressBar.tsx
β β βββ NavBar.tsx
| | βββ WeatherCard.tsx
β βββ forecast.ts
β βββ geocode.ts
β βββ main.css
β βββ main.tsx
β βββ sample_forecast.json
β βββ types.ts
β βββ vite-env.d.ts
βββ server
βββ cache.ts
βββ server.ts
- Implemented a component to display a single forecast "item"
- In
App.tsx, implementd a function to pass to theonAddressSubmitprop ofAddressBarthat handles:- fetching the weather forecast for the provided address
- showing an alert box if the address can't be geo-coded
- displaying the resulting weather forecast
