({ navigation }: Props)
| 130 | ); |
| 131 | |
| 132 | export default function ExampleList({ navigation }: Props) { |
| 133 | const keyExtractor = (item: { id: string }) => item.id; |
| 134 | |
| 135 | const { colors, isV3 } = useExampleTheme(); |
| 136 | const safeArea = useSafeAreaInsets(); |
| 137 | |
| 138 | const renderItem = ({ item }: { item: Item }) => { |
| 139 | const { data, id } = item; |
| 140 | |
| 141 | if (!isV3 && data.title === mainExamples.themingWithReactNavigation.title) { |
| 142 | return null; |
| 143 | } |
| 144 | |
| 145 | return ( |
| 146 | <List.Item |
| 147 | unstable_pressDelay={65} |
| 148 | title={data.title} |
| 149 | onPress={() => navigation.navigate(id)} |
| 150 | /> |
| 151 | ); |
| 152 | }; |
| 153 | |
| 154 | return ( |
| 155 | <FlatList |
| 156 | contentContainerStyle={{ |
| 157 | backgroundColor: colors.background, |
| 158 | paddingBottom: safeArea.bottom, |
| 159 | paddingLeft: safeArea.left, |
| 160 | paddingRight: safeArea.right, |
| 161 | }} |
| 162 | style={{ |
| 163 | backgroundColor: colors.background, |
| 164 | }} |
| 165 | showsVerticalScrollIndicator={false} |
| 166 | ItemSeparatorComponent={Divider} |
| 167 | renderItem={renderItem} |
| 168 | keyExtractor={keyExtractor} |
| 169 | data={data} |
| 170 | /> |
| 171 | ); |
| 172 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…