Skip to content

Instantly share code, notes, and snippets.

@abhishekjakhar
Last active June 17, 2019 00:21
Show Gist options
  • Save abhishekjakhar/6980f5532ab88456a61db6949e43398d to your computer and use it in GitHub Desktop.
Save abhishekjakhar/6980f5532ab88456a61db6949e43398d to your computer and use it in GitHub Desktop.
React Fragment (Table Component)
import React from 'react';
import TableColumns from './TableColumns';
const teachers = [
{ id: 1, name: 'Abhishek', subject: 'React' },
{ id: 2, name: 'Aakash', subject: 'JavaScript' }
]
const Table = () => (
<table>
{
teachers.map(teacher => <tr>
<TableColumns
key={teacher.id.toString()}
name={teacher.name}
subject={teacher.subject}/>
</tr>
)
}
</table>
);
export default Table;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment