With Table components, it's rare that you'll have static markup that defines the row data of the table. Instead, component state will map to the rows that make up your table data. For example, you might have a component that fetches API data that you want displayed in a table.
Stateful tables
How to do it...
Let's say that you have a component that fetches data from an API endpoint. When the data loads, you want to display the tabular data in a Material-UI Table component. Here's what the code looks like:
import React, { useState, useEffect } from 'react';
import { makeStyles } from '@material-ui/styles';
import Table from '@material-ui/core/Table';
import TableBody from &apos...