Summary: Changelog: [Internal] - Refactor SectionListExample

Reviewed By: kacieb

Differential Revision: D29480050

fbshipit-source-id: edaa21e12d4be0fbe3d6cf147c74b8144eb7c3de
This commit is contained in:
Luna Wei 2021-07-01 14:33:45 -07:00 коммит произвёл Facebook GitHub Bot
Родитель fa3243ad33
Коммит fd08255b0b
4 изменённых файлов: 30 добавлений и 15 удалений

Просмотреть файл

@ -146,7 +146,9 @@ const onScrollToIndexFailed = (info: {
*/
};
function SectionListExample(Props: {...}): React.Element<typeof RNTesterPage> {
export function SectionList_scrollable(Props: {
...,
}): React.Element<typeof RNTesterPage> {
const scrollPos = new Animated.Value(0);
const scrollSinkY = Animated.event(
[{nativeEvent: {contentOffset: {y: scrollPos}}}],
@ -338,16 +340,10 @@ const styles = StyleSheet.create({
},
});
exports.title = 'SectionList';
exports.category = 'ListView';
exports.documentationURL = 'https://reactnative.dev/docs/sectionlist';
exports.description = 'Performant, scrollable list of data.';
exports.showIndividualExamples = true;
exports.examples = [
{
title: 'Simple scrollable list',
render: function(): React.Element<typeof SectionListExample> {
return <SectionListExample />;
},
export default {
title: 'SectionList scrollable',
name: 'SectionList-scrollable',
render: function(): React.Element<typeof SectionList_scrollable> {
return <SectionList_scrollable />;
},
];
};

Просмотреть файл

@ -0,0 +1,19 @@
/**
* 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_Scrollable from './SectionList-scrollable';
exports.title = 'SectionList';
exports.category = 'ListView';
exports.documentationURL = 'https://reactnative.dev/docs/sectionlist';
exports.description = 'Performant, scrollable list of data.';
exports.examples = [SectionList_Scrollable];

Просмотреть файл

@ -122,7 +122,7 @@ const Components: Array<RNTesterModuleInfo> = [
{
key: 'SectionListExample',
category: 'ListView',
module: require('../examples/SectionList/SectionListExample'),
module: require('../examples/SectionList/SectionListIndex'),
},
{
key: 'StatusBarExample',

Просмотреть файл

@ -145,7 +145,7 @@ const Components: Array<RNTesterModuleInfo> = [
},
{
key: 'SectionListExample',
module: require('../examples/SectionList/SectionListExample'),
module: require('../examples/SectionList/SectionListIndex'),
category: 'ListView',
supportsTVOS: true,
},