Skip to content

Commit

Permalink
Move selectedRow state variable to top of function definition
Browse files Browse the repository at this point in the history
  • Loading branch information
campb303 authored Nov 3, 2020
1 parent 989f148 commit b7726e0
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/components/ItemTable/ItemTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import ItemTableFilter from "../ItemTableFilter/"
import { ArrowDownward, ArrowUpward } from "@material-ui/icons";

export default function ItemTable({ data }) {

const [selectedRow, setSelecetedRow] = useState({ queue: null, number: null });

const theme = useTheme();
const useStyles = makeStyles({
// Fully visible for active icons
Expand All @@ -29,7 +30,6 @@ export default function ItemTable({ data }) {
backgroundColor: theme.palette.type === 'light' ? theme.palette.grey[50] : theme.palette.grey[700],
},
},

columnBorders: {
borderLeftWidth: "1px",
borderLeftStyle: "solid",
Expand Down Expand Up @@ -71,11 +71,8 @@ export default function ItemTable({ data }) {
},
useFilters, useFlexLayout, useSortBy,
);

const { getTableProps, getTableBodyProps, headerGroups, rows, prepareRow, } = tableInstance;

const [selectedRow, setSelecetedRow] = useState({ queue: null, number: null });

return (
<TableContainer component={Paper} >
<Table {...getTableProps} aria-label="Table of Queue Items" >
Expand Down Expand Up @@ -158,4 +155,4 @@ ItemTable.propTypes = {

ItemTable.defaultProps = {
"items": []
};
};

0 comments on commit b7726e0

Please sign in to comment.