react-native-scroll-bottom-sheet icon indicating copy to clipboard operation
react-native-scroll-bottom-sheet copied to clipboard

Typing issue on `innerRef`

Open alexstrat opened this issue 5 years ago • 0 comments

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>;
}

alexstrat avatar Oct 08 '20 18:10 alexstrat