为什么不在我的列表中调用 onSectionRendered?
Why isn't onSectionRendered being called on my List?
由于某些原因,我的列表中没有调用 onSectionRendered。其他一切工作正常。不确定我是否传递正确。当我最初加载网格列表或不同的行变得可见时,它不会呈现。
<AutoSizer>
{({ width, height }) =>
<List
ref={this.set_reference}
className={stylesheet.nestedVirtualizedList}
width={width}
height={height}
onSectionRendered={()=>{console.log('Please show up ;(')}}
onScroll={this.update_scroller_position}
rowCount={this.props.data.length}
rowHeight={(this.props.get_dynamic_height) ? this.props.get_dynamic_height : height}
rowRenderer={this.render_row}
overscanRowCount={this.props.overscan_row_count}
/>
}
</AutoSizer>
我也试过这个...
<AutoSizer>
{({ width, height }) =>
<List
{...{onSectionRendered:this.on_section_rendered}}
ref={this.set_reference}
className={stylesheet.nestedVirtualizedList}
width={width}
height={height}
onScroll={this.update_scroller_position}
rowCount={this.props.data.length}
rowHeight={(this.props.get_dynamic_height) ? this.props.get_dynamic_height : height}
rowRenderer={this.render_row}
overscanRowCount={this.props.overscan_row_count}
/>
}
</AutoSizer>
List
属性被命名为onRowsRendered
(检查docs):
onRowsRendered
Callback invoked with information about the slice of rows that were just rendered: ({ overscanStartIndex: number, overscanStopIndex: number, startIndex: number, stopIndex: number }): void
由于某些原因,我的列表中没有调用 onSectionRendered。其他一切工作正常。不确定我是否传递正确。当我最初加载网格列表或不同的行变得可见时,它不会呈现。
<AutoSizer>
{({ width, height }) =>
<List
ref={this.set_reference}
className={stylesheet.nestedVirtualizedList}
width={width}
height={height}
onSectionRendered={()=>{console.log('Please show up ;(')}}
onScroll={this.update_scroller_position}
rowCount={this.props.data.length}
rowHeight={(this.props.get_dynamic_height) ? this.props.get_dynamic_height : height}
rowRenderer={this.render_row}
overscanRowCount={this.props.overscan_row_count}
/>
}
</AutoSizer>
我也试过这个...
<AutoSizer>
{({ width, height }) =>
<List
{...{onSectionRendered:this.on_section_rendered}}
ref={this.set_reference}
className={stylesheet.nestedVirtualizedList}
width={width}
height={height}
onScroll={this.update_scroller_position}
rowCount={this.props.data.length}
rowHeight={(this.props.get_dynamic_height) ? this.props.get_dynamic_height : height}
rowRenderer={this.render_row}
overscanRowCount={this.props.overscan_row_count}
/>
}
</AutoSizer>
List
属性被命名为onRowsRendered
(检查docs):
onRowsRendered
Callback invoked with information about the slice of rows that were just rendered: ({ overscanStartIndex: number, overscanStopIndex: number, startIndex: number, stopIndex: number }): void