diff --git a/packages/rn-tester/js/examples/SectionList/SectionListExample.js b/packages/rn-tester/js/examples/SectionList/SectionList-scrollable.js similarity index 94% rename from packages/rn-tester/js/examples/SectionList/SectionListExample.js rename to packages/rn-tester/js/examples/SectionList/SectionList-scrollable.js index ac9c8392310..78c28ae4f02 100644 --- a/packages/rn-tester/js/examples/SectionList/SectionListExample.js +++ b/packages/rn-tester/js/examples/SectionList/SectionList-scrollable.js @@ -146,7 +146,9 @@ const onScrollToIndexFailed = (info: { */ }; -function SectionListExample(Props: {...}): React.Element { +export function SectionList_scrollable(Props: { + ..., +}): React.Element { 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 { - return ; - }, +export default { + title: 'SectionList scrollable', + name: 'SectionList-scrollable', + render: function(): React.Element { + return ; }, -]; +}; diff --git a/packages/rn-tester/js/examples/SectionList/SectionListIndex.js b/packages/rn-tester/js/examples/SectionList/SectionListIndex.js new file mode 100644 index 00000000000..743865b1f3e --- /dev/null +++ b/packages/rn-tester/js/examples/SectionList/SectionListIndex.js @@ -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]; diff --git a/packages/rn-tester/js/utils/RNTesterList.android.js b/packages/rn-tester/js/utils/RNTesterList.android.js index f3a58071057..43ba938335d 100644 --- a/packages/rn-tester/js/utils/RNTesterList.android.js +++ b/packages/rn-tester/js/utils/RNTesterList.android.js @@ -122,7 +122,7 @@ const Components: Array = [ { key: 'SectionListExample', category: 'ListView', - module: require('../examples/SectionList/SectionListExample'), + module: require('../examples/SectionList/SectionListIndex'), }, { key: 'StatusBarExample', diff --git a/packages/rn-tester/js/utils/RNTesterList.ios.js b/packages/rn-tester/js/utils/RNTesterList.ios.js index 2292288ee01..cb7221a1222 100644 --- a/packages/rn-tester/js/utils/RNTesterList.ios.js +++ b/packages/rn-tester/js/utils/RNTesterList.ios.js @@ -145,7 +145,7 @@ const Components: Array = [ }, { key: 'SectionListExample', - module: require('../examples/SectionList/SectionListExample'), + module: require('../examples/SectionList/SectionListIndex'), category: 'ListView', supportsTVOS: true, },