Last active
June 17, 2019 00:21
-
-
Save abhishekjakhar/6980f5532ab88456a61db6949e43398d to your computer and use it in GitHub Desktop.
React Fragment (Table Component)
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
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