Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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