Skip to content

Instantly share code, notes, and snippets.

@eamonnboyle
Created February 23, 2021 11:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eamonnboyle/db26c575d2c12d5a2cb79197c23de17d to your computer and use it in GitHub Desktop.
Save eamonnboyle/db26c575d2c12d5a2cb79197c23de17d to your computer and use it in GitHub Desktop.
Weather App Tutorial - Rendering Forecast
export const WeatherSummary: FC<WeatherSummaryProps> = ({location}) => {
...
if (!location || !weather || !forecast) return null;
return (
<div>
<hr/>
<h2>{location.name}</h2>
<WeatherEntry weather={weather}/>
<h2>Forecast</h2>
<div>
<ol>
{forecast.map(timePoint =>
<li key={timePoint.dt}>
<WeatherEntry weather={timePoint}/>
</li>
)}
</ol>
</div>
</div>
);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment