From b71ae59545eee43e90bdc262ddd49e961819584d Mon Sep 17 00:00:00 2001 From: John Knox Date: Mon, 9 Sep 2019 06:49:30 -0700 Subject: [PATCH] TableNativePlugin Reviewed By: passy Differential Revision: D17258701 fbshipit-source-id: 0d622e63cc028969c9c6d51c5aa2cc8977aac151 --- src/plugins/TableNativePlugin.tsx | 48 +++++++++++++++++-------------- src/ui/components/ErrorBlock.tsx | 2 +- 2 files changed, 28 insertions(+), 22 deletions(-) diff --git a/src/plugins/TableNativePlugin.tsx b/src/plugins/TableNativePlugin.tsx index 4cde22ba3..537215b5c 100644 --- a/src/plugins/TableNativePlugin.tsx +++ b/src/plugins/TableNativePlugin.tsx @@ -140,20 +140,23 @@ function buildRow( } const oldColumns = previousRowData && previousRowData.columns - ? Object.keys(previousRowData.columns).reduce((map, key) => { - if (key !== 'id') { - let value = null; - if (previousRowData && previousRowData.columns) { - value = previousRowData.columns[key].value; - } + ? Object.keys(previousRowData.columns).reduce( + (map: {[key: string]: {value: any; isFilterable: boolean}}, key) => { + if (key !== 'id') { + let value = null; + if (previousRowData && previousRowData.columns) { + value = previousRowData.columns[key].value; + } - map[key] = { - value, - isFilterable: true, - }; - } - return map; - }, {}) + map[key] = { + value, + isFilterable: true, + }; + } + return map; + }, + {}, + ) : {}; const columns = Object.keys(rowData.columns).reduce((map, key) => { if (rowData.columns && key !== 'id') { @@ -186,10 +189,13 @@ function renderToolbar(section: ToolbarSection) { return [ ,