File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ import {
18
18
AgGridEvent ,
19
19
GetRowIdParams ,
20
20
} from 'ag-grid-community' ;
21
- import { RefObject } from 'react' ;
21
+ import { RefObject , useCallback } from 'react' ;
22
22
23
23
interface DirectoryContentTableProps
24
24
extends Pick <
@@ -69,12 +69,15 @@ export const DirectoryContentTable = ({
69
69
onGridReady,
70
70
colDef,
71
71
} : DirectoryContentTableProps ) => {
72
- const getCustomRowStyle = ( cellData : RowClassParams < ElementAttributes > ) => {
73
- return {
74
- ...getClickableRowStyle ( cellData ) ,
75
- ...getRowStyle ?.( cellData ) ,
76
- } ;
77
- } ;
72
+ const getCustomRowStyle = useCallback (
73
+ ( cellData : RowClassParams < ElementAttributes > ) => {
74
+ return {
75
+ ...getClickableRowStyle ( cellData ) ,
76
+ ...getRowStyle ?.( cellData ) ,
77
+ } ;
78
+ } ,
79
+ [ getRowStyle ]
80
+ ) ;
78
81
79
82
return (
80
83
< CustomAGGrid
You can’t perform that action at this time.
0 commit comments