March 2019
Intermediate to advanced
534 pages
14h 52m
English
Let's say that you have a table with rows that have servers that can be turned on or off, depending on their current state. You want to include both of these actions as part of each table row, so that the user can more easily control their servers without spending lots of time navigating. The buttons also need to change their color and disabled state based on the state of the row.
Here's the code to do this:
import React, { useState } from 'react';import { makeStyles } from '@material-ui/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'; ...Read now
Unlock full access