React.js — Create a table with expand functionality using react-table
2 min readOct 24, 2022
Here is the code on how to click a a row to expand using react-table.
index.js
import React from "react";import { render } from "react-dom";import { makeData, Logo, Tips } from "./Utils";// Import React Tableimport ReactTable from "react-table";import "react-table/react-table.css";const columns = [{Header: "Name",columns: [{Header: "First Name",accessor: "firstName"},{Header: "Last Name",id: "lastName",accessor: d => d.lastName}]},{Header: "Info",columns: [{Header: "Age",accessor: "age"},{Header: "Status",