Skip to content

Instantly share code, notes, and snippets.

@itsMapleLeaf
Created February 12, 2018 03:13
Show Gist options
  • Save itsMapleLeaf/ba8bfa8417c1ba2e6b3203a3a5233adc to your computer and use it in GitHub Desktop.
Save itsMapleLeaf/ba8bfa8417c1ba2e6b3203a3a5233adc to your computer and use it in GitHub Desktop.
React map example
import React from 'react'
const timelineEvents = [
{
date: 'January',
note: 'Words words words',
},
{
date: 'March',
note: 'Scaling open maps for Jakarta flooding — and printed maps',
},
{
date: 'August',
note: 'more stuff ',
},
{
date: 'September',
note: ['Hurricane Harvey recovery maps', 'dfdfdfff'],
},
{
date: 'October',
note: 'Resdfsdfd dgdgdg',
},
{
date: 'November',
note: 'omus omus mos',
},
{
date: 'December',
note: 'rrrrrrs',
},
]
function EventsTimeline() {
const eventDescriptionElements = timelineEvents.map((event, i) => {
return (
// key is required to silence the react warning
<p key={i} className="txt-s">
{event.note}
</p>
)
})
return <div>{eventDescriptionElements}</div>
}
export default EventsTimeline
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment