How to do it...

Let's say that you have a table with lots of rows in it, meaning that the user is going to have a tough time scrolling through the entire table. To make things easier for them, you decide to add a search feature to your table that filters rows by checking whether the search text exists within the name column. Here's the code:

import React, { useState, useEffect, Fragment } from 'react';import { makeStyles } from '@material-ui/styles';import { withStyles } from '@material-ui/core/styles';import Table from '@material-ui/core/Table';import TableBody from '@material-ui/core/TableBody';import TableCell from '@material-ui/core/TableCell';import TableHead from '@material-ui/core/TableHead';import TableRow from '@material-ui/core/TableRow'; ...

Get React Material-UI Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.