Skip to content

Instantly share code, notes, and snippets.

@andreipfeiffer
Last active February 15, 2017 14:18
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 andreipfeiffer/9697552a99022f8554d0ca9d252e9110 to your computer and use it in GitHub Desktop.
Save andreipfeiffer/9697552a99022f8554d0ca9d252e9110 to your computer and use it in GitHub Desktop.
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