@@ -31,6 +31,7 @@ export interface BodyRowProps<RecordType> {
3131 colSpan : number ;
3232 sticky : number ;
3333 } ;
34+ forceRender ?: boolean | ( ( record : RecordType , index : number ) => boolean ) ;
3435}
3536
3637// ==================================================================================
@@ -138,6 +139,7 @@ const BodyRow = <RecordType extends { children?: readonly RecordType[] }>(
138139 cellComponent,
139140 scopeCellComponent,
140141 expandedRowInfo,
142+ forceRender,
141143 } = props ;
142144
143145 const rowInfo = useRowInfo ( record , rowKey , index , indent ) ;
@@ -157,6 +159,13 @@ const BodyRow = <RecordType extends { children?: readonly RecordType[] }>(
157159 const expandedRef = React . useRef ( false ) ;
158160 expandedRef . current ||= expanded ;
159161
162+ const shouldForceRender = ( ) => {
163+ if ( typeof forceRender === 'function' ) {
164+ return forceRender ( record , index ) ;
165+ }
166+ return ! ! forceRender ;
167+ } ;
168+
160169 if ( process . env . NODE_ENV !== 'production' ) {
161170 devRenderTimes ( props ) ;
162171 }
@@ -224,7 +233,7 @@ const BodyRow = <RecordType extends { children?: readonly RecordType[] }>(
224233
225234 // ======================== Expand Row =========================
226235 let expandRowNode : React . ReactElement < ExpandedRowProps > ;
227- if ( rowSupportExpand && ( expandedRef . current || expanded ) ) {
236+ if ( rowSupportExpand && ( expandedRef . current || expanded || shouldForceRender ?. ( ) ) ) {
228237 const expandContent = expandedRowRender ( record , index , indent + 1 , expanded ) ;
229238
230239 expandRowNode = (
0 commit comments