1.0.1 • Published 2 years ago

react-iterative-table v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

REACT-ITERATIVE-TABLE

import React from 'react';
import ReactDOM from 'react-dom/client';
import { Table, Col } from 'react-iterative-table';

const arr = [
  { id: 1, name: 'Zahrah Morin', color: 'Salmon pink' },
  { id: 2, name: 'Sania Russell', color: 'Quartz grey' },
  { id: 3, name: 'Yaqub Vaughan', color: 'Light blue' },
  { id: 4, name: 'Alasdair Andrew', color: 'May green' },
  { id: 5, name: 'Alexander Cervantes', color: 'Signal blue' },
  { id: 6, name: 'Leandro Clarkson', color: 'Cobalt blue' },
]

const root = ReactDOM.createRoot(
  document.getElementById('root') as HTMLElement
);

root.render(
  <React.StrictMode>
    <Table it={arr.length} >
      <Col func={i => arr[i].id} >ID</Col>
      <Col func={i => arr[i].name} >Name</Col>
      <Col func={i => arr[i].color} >Color</Col>
    </Table>
  </React.StrictMode>
);