Skip to content

Instantly share code, notes, and snippets.

@abhishekjakhar
Last active Jun 17, 2019
Embed
What would you like to do?
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