From 8028b28b8ed5f00ac3d5a78fd7baf5f4c1484961 Mon Sep 17 00:00:00 2001 From: Jacek Kolasa Date: Wed, 26 Oct 2022 10:17:20 +0200 Subject: [PATCH] fix 3 no-key warnings when no actions are provided to the table --- src/components/tableV2/netdataTable.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/tableV2/netdataTable.js b/src/components/tableV2/netdataTable.js index 32c8826fb..1e918a5ab 100644 --- a/src/components/tableV2/netdataTable.js +++ b/src/components/tableV2/netdataTable.js @@ -4,11 +4,11 @@ import React, { useEffect, useMemo, useRef, useState } from "react" import Table, { Pagination } from "./base-table" import { + flexRender, getCoreRowModel, getFilteredRowModel, getPaginationRowModel, getSortedRowModel, - flexRender, useReactTable, } from "@tanstack/react-table" @@ -127,6 +127,7 @@ const NetdataTable = ({ const makeColumnVisibilityAction = useMemo( () => ({ + id: "columnVisibility", handleAction: () => setIsColumnDropdownVisible(true), visible: enableColumnVisibility, icon: "gear", @@ -556,7 +557,7 @@ const renderActions = ({ actions, testPrefix }) => { } const renderBulkActions = ({ bulkActions, table, testPrefix, selectedRows }) => { - if (!bulkActions || !bulkActions.length) return + if (!bulkActions || !bulkActions.length) return return bulkActions.map( ({ id, icon, handleAction, tooltipText, alwaysEnabled, isDisabled, isVisible, ...rest }) => { const disabled = typeof isDisabled === "function" ? isDisabled() : isDisabled @@ -661,11 +662,10 @@ const renderActionWithDropdown = ({ const actionRef = useRef() return ( - <> + - + ) } )