Last active
February 15, 2017 14:18
-
-
Save andreipfeiffer/9697552a99022f8554d0ca9d252e9110 to your computer and use it in GitHub Desktop.
This file contains 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
let { items } = this.props; | |
let children; | |
if (items.length > 0) { | |
children = ( | |
<ul> | |
{items.map(item => | |
<li key={item.id}>{item.name}</li> | |
)} | |
</ul> | |
); | |
} else { | |
children = <p>No items found.</p>; | |
} | |
return ( | |
<div className='list-container'> | |
{children} | |
</div> | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment