/** * 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 * as React from 'react'; import { Platform, ScrollView, StyleSheet, Text, TouchableOpacity, View, TextInput, RefreshControl, } from 'react-native'; import nullthrows from 'nullthrows'; import {useState, useCallback} from 'react'; import type {RNTesterModuleExample} from '../../types/RNTesterTypes'; import type {ViewStyleProp} from 'react-native/Libraries/StyleSheet/StyleSheet'; import ScrollViewPressableStickyHeaderExample from './ScrollViewPressableStickyHeaderExample'; exports.displayName = 'ScrollViewExample'; exports.title = 'ScrollView'; exports.documentationURL = 'https://reactnative.dev/docs/scrollview'; exports.category = 'Basic'; exports.description = 'Component that enables scrolling through child components'; exports.examples = ([ { name: 'scrollTo', title: '\n', description: 'To make content scrollable, wrap it within a component', render: function(): React.Node { let _scrollView: ?React.ElementRef; return ( { _scrollView = scrollView; }} automaticallyAdjustContentInsets={false} onScroll={() => { console.log('onScroll!'); }} scrollEventThrottle={200} style={styles.scrollView} testID="scroll_vertical"> {ITEMS.map(createItemRow)}