mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
Summary: Changelog: [General][Changed] - Updated SectionList example in RNTester Lists need an explicit height set, otherwise their intrinsic height is the height of the root view. This causes rendering issues as shown in the test plan. Additionally, refactored to allow visibilityConfig to be passed as prop for future tests. Reviewed By: kacieb Differential Revision: D27098086 fbshipit-source-id: b19155de79d00dddc287a1e2f9cdb240f2f31e27
41 lines
1.1 KiB
JavaScript
41 lines
1.1 KiB
JavaScript
/**
|
|
* 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.
|
|
*
|
|
* @format
|
|
* @flow
|
|
*/
|
|
|
|
'use strict';
|
|
import {SectionList_onViewableItemsChanged} from './SectionListExamples';
|
|
const React = require('react');
|
|
|
|
const VIEWABILITY_CONFIG = {
|
|
minimumViewTime: 1000,
|
|
viewAreaCoveragePercentThreshold: 100,
|
|
waitForInteraction: true,
|
|
};
|
|
|
|
exports.title = 'SectionList onViewableItemsChanged';
|
|
exports.testTitle = 'Test onViewableItemsChanged callback';
|
|
exports.category = 'ListView';
|
|
exports.documentationURL = 'https://reactnative.dev/docs/sectionlist';
|
|
exports.description =
|
|
'Scroll list to see what items are returned in `onViewableItemsChanged` callback.';
|
|
exports.examples = [
|
|
{
|
|
title: 'SectionList onViewableItemsChanged',
|
|
render: function(): React.Element<
|
|
typeof SectionList_onViewableItemsChanged,
|
|
> {
|
|
return (
|
|
<SectionList_onViewableItemsChanged
|
|
viewabilityConfig={VIEWABILITY_CONFIG}
|
|
/>
|
|
);
|
|
},
|
|
},
|
|
];
|