performance comments

This commit is contained in:
Jan Prochazka 2021-01-14 10:45:24 +01:00
parent f60ee04883
commit f2dbe1f103
2 changed files with 10 additions and 1 deletions

View File

@ -45,7 +45,13 @@ export default function DataGrid(props) {
<ReferenceManager {...props} managerSize={managerSize} />
</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 ? (
<CellDataView selectedValue={formSelection} />
) : (

View File

@ -1062,6 +1062,9 @@ export default function DataGridCore(props) {
{_.range(firstVisibleRowScrollIndex, firstVisibleRowScrollIndex + visibleRowCountUpperBound).map(
(rowIndex) => (
<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}
grider={grider}
rowIndex={rowIndex}