0

For some reason onSectionRendered is not being called on my List. Everything else is working fine. Not sure If i'm passing it in right. It doesn't render when i initially load the Grid List nor when different rows become visible.

<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>

I have also tried this...

<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>
user1730335
  • 59
  • 1
  • 5

1 Answers1

0

The List property is named onRowsRendered (check the docs):

onRowsRendered

Callback invoked with information about the slice of rows that were just rendered: ({ overscanStartIndex: number, overscanStopIndex: number, startIndex: number, stopIndex: number }): void

Community
  • 1
  • 1
bvaughn
  • 13,300
  • 45
  • 46