• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

facebook / react-native / af585971-f736-432c-90fc-8c3de5e01da3

pending completion
af585971-f736-432c-90fc-8c3de5e01da3

push

CircleCI

Facebook GitHub Bot
ESM ActivityIndicator

3633 of 26411 branches covered (13.76%)

Branch coverage included in aggregate %.

2 of 2 new or added lines in 1 file covered. (100.0%)

7424 of 44591 relevant lines covered (16.65%)

241.33 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

87.5
/Libraries/Components/ScrollView/ScrollViewNativeComponent.js
1
/**
2
 * Copyright (c) Meta Platforms, Inc. and affiliates.
3
 *
4
 * This source code is licensed under the MIT license found in the
5
 * LICENSE file in the root directory of this source tree.
6
 *
7
 * @flow strict-local
8
 * @format
9
 */
10

11
import type {
12
  HostComponent,
13
  PartialViewConfig,
14
} from '../../Renderer/shims/ReactNativeTypes';
15
import type {ScrollViewNativeProps as Props} from './ScrollViewNativeComponentType';
16

17
import * as NativeComponentRegistry from '../../NativeComponent/NativeComponentRegistry';
17✔
18
import {ConditionallyIgnoredEventHandlers} from '../../NativeComponent/ViewConfigIgnore';
17✔
19
import Platform from '../../Utilities/Platform';
493✔
20

21
export const __INTERNAL_VIEW_CONFIG: PartialViewConfig =
22
  Platform.OS === 'android'
17!
23
    ? {
24
        uiViewClassName: 'RCTScrollView',
25
        bubblingEventTypes: {},
26
        directEventTypes: {
27
          topMomentumScrollBegin: {
28
            registrationName: 'onMomentumScrollBegin',
29
          },
30
          topMomentumScrollEnd: {
31
            registrationName: 'onMomentumScrollEnd',
32
          },
33
          topScroll: {
34
            registrationName: 'onScroll',
35
          },
36
          topScrollBeginDrag: {
37
            registrationName: 'onScrollBeginDrag',
38
          },
39
          topScrollEndDrag: {
40
            registrationName: 'onScrollEndDrag',
41
          },
42
        },
43
        validAttributes: {
44
          contentOffset: {
45
            diff: require('../../Utilities/differ/pointsDiffer'),
46
          },
47
          decelerationRate: true,
48
          disableIntervalMomentum: true,
49
          pagingEnabled: true,
50
          scrollEnabled: true,
51
          showsVerticalScrollIndicator: true,
52
          snapToAlignment: true,
53
          snapToEnd: true,
54
          snapToInterval: true,
55
          snapToOffsets: true,
56
          snapToStart: true,
57
          borderBottomLeftRadius: true,
58
          borderBottomRightRadius: true,
59
          sendMomentumEvents: true,
60
          borderRadius: true,
61
          nestedScrollEnabled: true,
62
          borderStyle: true,
63
          borderRightColor: {
64
            process: require('../../StyleSheet/processColor').default,
65
          },
66
          borderColor: {
67
            process: require('../../StyleSheet/processColor').default,
68
          },
69
          borderBottomColor: {
70
            process: require('../../StyleSheet/processColor').default,
71
          },
72
          persistentScrollbar: true,
73
          endFillColor: {
74
            process: require('../../StyleSheet/processColor').default,
75
          },
76
          fadingEdgeLength: true,
77
          overScrollMode: true,
78
          borderTopLeftRadius: true,
79
          scrollPerfTag: true,
80
          borderTopColor: {
81
            process: require('../../StyleSheet/processColor').default,
82
          },
83
          removeClippedSubviews: true,
84
          borderTopRightRadius: true,
85
          borderLeftColor: {
86
            process: require('../../StyleSheet/processColor').default,
87
          },
88
          pointerEvents: true,
89
        },
90
      }
91
    : {
92
        uiViewClassName: 'RCTScrollView',
93
        bubblingEventTypes: {},
94
        directEventTypes: {
95
          topMomentumScrollBegin: {
96
            registrationName: 'onMomentumScrollBegin',
97
          },
98
          topMomentumScrollEnd: {
99
            registrationName: 'onMomentumScrollEnd',
100
          },
101
          topScroll: {
102
            registrationName: 'onScroll',
103
          },
104
          topScrollBeginDrag: {
105
            registrationName: 'onScrollBeginDrag',
106
          },
107
          topScrollEndDrag: {
108
            registrationName: 'onScrollEndDrag',
109
          },
110
          topScrollToTop: {
111
            registrationName: 'onScrollToTop',
112
          },
113
        },
114
        validAttributes: {
115
          alwaysBounceHorizontal: true,
116
          alwaysBounceVertical: true,
117
          automaticallyAdjustContentInsets: true,
118
          automaticallyAdjustKeyboardInsets: true,
119
          automaticallyAdjustsScrollIndicatorInsets: true,
120
          bounces: true,
121
          bouncesZoom: true,
122
          canCancelContentTouches: true,
123
          centerContent: true,
124
          contentInset: {
125
            diff: require('../../Utilities/differ/insetsDiffer'),
126
          },
127
          contentOffset: {
128
            diff: require('../../Utilities/differ/pointsDiffer'),
129
          },
130
          contentInsetAdjustmentBehavior: true,
131
          decelerationRate: true,
132
          directionalLockEnabled: true,
133
          disableIntervalMomentum: true,
134
          indicatorStyle: true,
135
          inverted: true,
136
          keyboardDismissMode: true,
137
          maintainVisibleContentPosition: true,
138
          maximumZoomScale: true,
139
          minimumZoomScale: true,
140
          pagingEnabled: true,
141
          pinchGestureEnabled: true,
142
          scrollEnabled: true,
143
          scrollEventThrottle: true,
144
          scrollIndicatorInsets: {
145
            diff: require('../../Utilities/differ/insetsDiffer'),
146
          },
147
          scrollToOverflowEnabled: true,
148
          scrollsToTop: true,
149
          showsHorizontalScrollIndicator: true,
150
          showsVerticalScrollIndicator: true,
151
          snapToAlignment: true,
152
          snapToEnd: true,
153
          snapToInterval: true,
154
          snapToOffsets: true,
155
          snapToStart: true,
156
          zoomScale: true,
157
          ...ConditionallyIgnoredEventHandlers({
158
            onScrollBeginDrag: true,
159
            onMomentumScrollEnd: true,
160
            onScrollEndDrag: true,
161
            onMomentumScrollBegin: true,
162
            onScrollToTop: true,
163
            onScroll: true,
164
          }),
165
        },
166
      };
17✔
167

168
const ScrollViewNativeComponent: HostComponent<Props> =
169
  NativeComponentRegistry.get<Props>(
17✔
170
    'RCTScrollView',
171
    () => __INTERNAL_VIEW_CONFIG,
×
172
  );
173

174
export default ScrollViewNativeComponent;
17✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc