/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow strict-local * @format */ import { Pressable, Button, SectionList, StyleSheet, Text, View, } from 'react-native'; import * as React from 'react'; const DATA = [ { title: 'Main dishes', data: ['Pizza', 'Burger', 'Risotto'], }, { title: 'Sides', data: ['French Fries', 'Onion Rings', 'Fried Shrimps'], }, { title: 'Drinks', data: ['Water', 'Coke', 'Beer'], }, { title: 'Desserts', data: ['Cheesecake', 'Ice Cream'], }, ]; const Item = ({item, section, separators}) => { return ( { separators.highlight(); }} onPress={() => { separators.updateProps('trailing', {hasBeenHighlighted: true}); separators.updateProps('leading', {hasBeenHighlighted: true}); }} onPressOut={() => { separators.unhighlight(); }} style={({pressed}) => [ styles.item, { backgroundColor: pressed ? 'red' : 'pink', }, ]} testID={item}> {item} ); }; type Props = { exampleProps: $Shape>, onTest?: ?() => void, testLabel?: ?string, testOutput?: ?string, children?: ?React.Node, }; const SectionListBaseExample: React.AbstractComponent< Props, React.ElementRef, > = React.forwardRef((props: Props, ref): React.Node => { return ( {props.testOutput != null ? ( {props.testOutput} {props.onTest != null ? (