jemise111 / react-native-swipe-list-view

A React Native ListView component with rows that swipe open and closed
https://www.npmjs.com/package/react-native-swipe-list-view
MIT License
2.79k stars 527 forks source link

Swipe-to-delete with TypeScript gives 'this' implicitly has type 'any' because it does not have a type annotation.ts(2683) #506

Closed ethankeshishian closed 4 years ago

ethankeshishian commented 4 years ago

I've tried to implement the swipe-to-delete example, but I keep encountering an error on this.animationIsRunning in onSwipeValueChange. Here's the error:

'this' implicitly has type 'any' because it does not have a type annotation.ts(2683)
MyLibraryScreen.tsx(25, 17): An outer value of 'this' is shadowed by this container.

I've even implemented the list exactly like the example, but the issue persists. I noticed that when I try to console.log(this), this is undefined. Any idea why? Thanks.

jemise111 commented 4 years ago

Hi @ethankeshishian, good call! this shouldn't be there. Fixed here: https://github.com/jemise111/react-native-swipe-list-view/pull/521