optimalizations, refactor

This commit is contained in:
Jan Prochazka
2020-03-22 20:17:38 +01:00
parent ce1e58dbdc
commit 1560b7c2e0
4 changed files with 149 additions and 124 deletions

View File

@@ -18,10 +18,18 @@ export default function TableDataTab({ conid, database, schemaName, pureName, ta
console.log('changeSet', changeSet);
const connection = useConnectionInfo(conid);
if (!tableInfo || !connection) return null;
const display = new TableGridDisplay(tableInfo, engines(connection), config, setConfig, cache, setCache, name =>
getTableInfo({ conid, database, ...name })
const display = React.useMemo(
() =>
tableInfo && connection
? new TableGridDisplay(tableInfo, engines(connection), config, setConfig, cache, setCache, name =>
getTableInfo({ conid, database, ...name })
)
: null,
[tableInfo, connection, config, cache]
);
if (!display) return null;
return (
<DataGrid
// key={`${conid}, ${database}, ${schemaName}, ${pureName}`}