mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-30 17:24:00 +00:00
performance comments
This commit is contained in:
@@ -45,7 +45,13 @@ export default function DataGrid(props) {
|
|||||||
<ReferenceManager {...props} managerSize={managerSize} />
|
<ReferenceManager {...props} managerSize={managerSize} />
|
||||||
</WidgetColumnBarItem>
|
</WidgetColumnBarItem>
|
||||||
)}
|
)}
|
||||||
<WidgetColumnBarItem title="Cell data" name="cellData" collapsed>
|
<WidgetColumnBarItem
|
||||||
|
title="Cell data"
|
||||||
|
name="cellData"
|
||||||
|
// cell data must be collapsed by default, because of performance reasons
|
||||||
|
// when not collapsed, onSelectionChanged of grid is set and RERENDER of this component is done on every selection change
|
||||||
|
collapsed
|
||||||
|
>
|
||||||
{isFormView ? (
|
{isFormView ? (
|
||||||
<CellDataView selectedValue={formSelection} />
|
<CellDataView selectedValue={formSelection} />
|
||||||
) : (
|
) : (
|
||||||
|
|||||||
@@ -1062,6 +1062,9 @@ export default function DataGridCore(props) {
|
|||||||
{_.range(firstVisibleRowScrollIndex, firstVisibleRowScrollIndex + visibleRowCountUpperBound).map(
|
{_.range(firstVisibleRowScrollIndex, firstVisibleRowScrollIndex + visibleRowCountUpperBound).map(
|
||||||
(rowIndex) => (
|
(rowIndex) => (
|
||||||
<DataGridRow
|
<DataGridRow
|
||||||
|
// this component use React.memo
|
||||||
|
// when adding props, check, whether they are correctly memoized and row is not rerendered
|
||||||
|
// uncomment line console.log('RENDER ROW', rowIndex); in DataGridRow.js for check
|
||||||
key={rowIndex}
|
key={rowIndex}
|
||||||
grider={grider}
|
grider={grider}
|
||||||
rowIndex={rowIndex}
|
rowIndex={rowIndex}
|
||||||
|
|||||||
Reference in New Issue
Block a user