An index was manually added to every iterable data passed to VirtualizedLists.
In convertToGrid function (dedicated to VirtualizedGrids), we saw that map gives access to the index of every item of data.
We can use the same for VirtualizedLists by using the index passed inside the renderItem prop.
The refactoring is cut in 2 parts :
Pass index to all components that use one (from bottom layers to top layers)
An index was manually added to every iterable data passed to
VirtualizedLists
. InconvertToGrid
function (dedicated toVirtualizedGrids
), we saw that map gives access to theindex
of every item of data.We can use the same for
VirtualizedLists
by using the index passed inside therenderItem
prop.The refactoring is cut in 2 parts :
Tests realized on Web :
https://github.com/bamlab/react-tv-space-navigation/assets/74320569/322a3917-6761-45b9-8402-8b46d0684a01
Some performance tests