react-native-sortable-list
react-native-sortable-list copied to clipboard
Add ability to send in height or width of the item
The feature came from a necessity of having different height items. When that happened, sorting the list would cause discrepancies in size because it was checking the rowsLayout with an old height. This helps base the height on something we might already have at the data level. The PR could still benefit from overriding the rowsLayout item itself since it would be more performant aswell to not calculate these values when we already have them but I'm new to the project and I implemented the MVP.
Here is an example usage:
const data = [
{ text: 'Foo', height: 10 },
{ text: 'Bar' }
];
The first data item would have a height as the basis and the second would one would be calculated.