rgommezz / react-native-scroll-bottom-sheet

Cross platform scrollable bottom sheet with virtualisation support, native animations at 60 FPS and fully implemented in JS land :fire:
MIT License
1.54k stars 64 forks source link

Typing issue on `innerRef` #52

Open alexstrat opened 3 years ago

alexstrat commented 3 years ago

innerRef prop actually gets a an AnimatedComponent<FlatList | ScrollView | SectionList> rather than just a FlatList | ScrollView | SectionList (the type AnimatedComponent<T> does not exist in reanimated though).

We should do something like this:

class AnimatedFlatList extends Component<AnimateProps<FlatListStyle, FlatListProps>> {
  getNode(): ReactNativeView;
}

// same for AnimatedScrollView and AnimatedSectionList

type Props = {
  ...,
  innerRef: RefObject<AnimatedFlatList | AnimatedScrollView | AnimatedSectionList>;
}