Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import React from 'react';
- // Expected records object structure
- // [
- // {id: 1, name: "John"},
- // {id: 2, name: "Josh"},
- // {id: 3, name: "Jean"}
- // ];
- function Table({records}) {
- return (
- <div>
- <table>
- <thead>
- <tr>
- <th>ID</th>
- <th>Name</th>
- </tr>
- </thead>
- <tbody>
- {records.map(record =>
- <tr key={record.id}>
- <td>{record.id}</td>
- <td>{record.name}</td>
- </tr>
- )}
- </tbody>
- </table>
- </div>
- );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement