about summary refs log tree commit diff
path: root/src/view/com/util/Views.tsx
blob: c9ba0728cc0e304f8eb564e86741dfe843562b1c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import {forwardRef} from 'react'
import {FlatListComponent} from 'react-native'
import {View, ViewProps} from 'react-native'
import Animated from 'react-native-reanimated'
import {FlatListPropsWithLayout} from 'react-native-reanimated'

// If you explode these into functions, don't forget to forwardRef!

/**
 * Avoid using `FlatList_INTERNAL` and use `List` where possible.
 * The types are a bit wrong on `FlatList_INTERNAL`
 */
export const FlatList_INTERNAL = Animated.FlatList
export type FlatList_INTERNAL<ItemT = any> = Omit<
  FlatListComponent<ItemT, FlatListPropsWithLayout<ItemT>>,
  'CellRendererComponent'
>

/**
 * @deprecated use `Layout` components
 */
export const ScrollView = Animated.ScrollView
export type ScrollView = typeof Animated.ScrollView

/**
 * @deprecated use `Layout` components
 */
export const CenteredView = forwardRef<
  View,
  React.PropsWithChildren<
    ViewProps & {sideBorders?: boolean; topBorder?: boolean}
  >
>(function CenteredView(props, ref) {
  return <View ref={ref} {...props} />
})