Created
February 12, 2018 03:13
-
-
Save itsMapleLeaf/ba8bfa8417c1ba2e6b3203a3a5233adc to your computer and use it in GitHub Desktop.
React map example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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