jsoendermann / rn-section-list-get-item-layout

:black_square_button: Easy getItemLayout props for react-native SectionLists.
https://medium.com/@jsoendermann/sectionlist-and-getitemlayout-2293b0b916fb
Other
221 stars 32 forks source link

Using TypeScript: 'rowData' and 'rowIndex' is declared but never used. #7

Closed stabenfeldt closed 6 years ago

stabenfeldt commented 6 years ago

This is more an TypeScript issue than an "rn-section-list-get-item-layout" issue. But I'm posting it here anyway as users of "rn-section-list-get-item-layout" might also be using TS. :-)


The TypeScript compiler complains about this line: getItemHeight: (rowData, sectionIndex, rowIndex) => sectionIndex === 0 ? 100 : 50,

error TS6133: 'rowData' is declared but never used.
error TS6133: 'rowIndex' is declared but never used.

I guess both rowData and rowIndex are used internally in the npm package. But how do I tell that to TypeScript?

jsoendermann commented 6 years ago

Hi @stabenfeldt I can't reproduce this error. If you make a small repo that causes this, I can take a look at it.

stabenfeldt commented 6 years ago

The error has disappeared. Not sure what made it go away, but I'll definitely make a small repo you can look at if it reappears. Thanks! :-)