Sometimes when scrolling through table rows, I receive warning: Failed prop type: The prop index
is marked as required in FixedDataTableRowImpl
, but its value is null
.
#644
Labels
In my case I receive warning when there are more rows to fit in the screen and I scroll to the bottom then start to scroll back to the top. In most times this is enough to get warning but not always.
If, I look at FixedDataTableBufferedRows.js code, I see that index can be null:
fixed-data-table-2/src/FixedDataTableBufferedRows.js
Lines 130 to 138 in 9aa115c
Debugging also approves this situation:
![image](https://user-images.githubusercontent.com/1721818/175011330-47b369aa-0665-4f3f-be47-439336ab0cbd.png)
![image](https://user-images.githubusercontent.com/1721818/175011391-a6109954-8096-46d4-b9b5-4ec5af82361d.png)
The biggest issue is not a warning in FixedDataTableRow.js but that table cell with rowIndex=null is rendered:
fixed-data-table-2/src/FixedDataTableCell.js
Line 310 in ad60599
When documentation in https://github.com/schrodinger/fixed-data-table-2 says:
The cell components in a column will receive the current array index of your data as a prop (this.props.rowIndex). Use this to access the correct value for each cell.
So, in my case I get rows[rowIndex]=undefined...
I can fix this for my case, but I guess that in such case cell renderer should not be called.
The text was updated successfully, but these errors were encountered: