Skip to content

Instantly share code, notes, and snippets.

@jake-daniels
Last active May 4, 2018 15:00
Show Gist options
  • Save jake-daniels/5501242897554c6f65e478212735d284 to your computer and use it in GitHub Desktop.
Save jake-daniels/5501242897554c6f65e478212735d284 to your computer and use it in GitHub Desktop.
Table component with single render method.
class Table extends React.Component {
render () {
return (
<div className='table'>
<div className='head'>
</div>
<div className='body'>
{this.props.items.map((item, index) => (
<div key={index} className='row'>
<div className='column'>
{item.someProperty}
</div>
{/* ...more columns */}
</div>
))}
</div>
</div>
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment