@@ -24,7 +24,10 @@ import { GRID_CHECKBOX_SELECTION_COL_DEF } from '../colDef/gridCheckboxSelection
24
24
import { GRID_ACTIONS_COLUMN_TYPE } from '../colDef/gridActionsColDef' ;
25
25
import { GRID_DETAIL_PANEL_TOGGLE_FIELD , PinnedColumnPosition } from '../internals/constants' ;
26
26
import { gridSortModelSelector } from '../hooks/features/sorting/gridSortingSelector' ;
27
- import { gridRowMaximumTreeDepthSelector } from '../hooks/features/rows/gridRowsSelector' ;
27
+ import {
28
+ gridRowMaximumTreeDepthSelector ,
29
+ gridRowNodeSelector ,
30
+ } from '../hooks/features/rows/gridRowsSelector' ;
28
31
import {
29
32
gridEditRowsStateSelector ,
30
33
gridRowIsEditingSelector ,
@@ -125,7 +128,7 @@ const GridRow = forwardRef<HTMLDivElement, GridRowProps>(function GridRow(props,
125
128
rowReordering ,
126
129
) ;
127
130
const handleRef = useForkRef ( ref , refProp ) ;
128
- const rowNode = apiRef . current . getRowNode ( rowId ) ;
131
+ const rowNode = gridRowNodeSelector ( apiRef , rowId ) ;
129
132
const editing = useGridSelector ( apiRef , gridRowIsEditingSelector , {
130
133
rowId,
131
134
editMode : rootProps . editMode ,
@@ -281,7 +284,7 @@ const GridRow = forwardRef<HTMLDivElement, GridRowProps>(function GridRow(props,
281
284
} , [ isNotVisible , rowHeight , styleProp , heightEntry , rootProps . rowSpacingType ] ) ;
282
285
283
286
const rowClassNames = apiRef . current . unstable_applyPipeProcessors ( 'rowClassName' , [ ] , rowId ) ;
284
- const ariaAttributes = rowNode ? getRowAriaAttributes ( rowNode , index ) : undefined ;
287
+ const ariaAttributes = getRowAriaAttributes ( rowNode , index ) ;
285
288
286
289
if ( typeof rootProps . getRowClassName === 'function' ) {
287
290
const indexRelativeToCurrentPage = index - ( currentPage . range ?. firstRowIndex || 0 ) ;
@@ -295,11 +298,6 @@ const GridRow = forwardRef<HTMLDivElement, GridRowProps>(function GridRow(props,
295
298
rowClassNames . push ( rootProps . getRowClassName ( rowParams ) ) ;
296
299
}
297
300
298
- /* Start of rendering */
299
- if ( ! rowNode ) {
300
- return null ;
301
- }
302
-
303
301
const getCell = (
304
302
column : GridStateColDef ,
305
303
indexInSection : number ,
@@ -328,7 +326,7 @@ const GridRow = forwardRef<HTMLDivElement, GridRowProps>(function GridRow(props,
328
326
scrollbarWidth ,
329
327
) ;
330
328
331
- if ( rowNode ? .type === 'skeletonRow' ) {
329
+ if ( rowNode . type === 'skeletonRow' ) {
332
330
return (
333
331
< slots . skeletonCell
334
332
key = { column . field }
0 commit comments