Files
react-native/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js
T
Jesse Katsumata d7b1d3359f chore: use es6 import for scroll view (#29184)
Summary:
Migrate ScrollView component to use ES6 import

motivation: trying to slowly migrate each files to use es6 import/exports to make this discussion happen
https://github.com/react-native-community/discussions-and-proposals/issues/201#issuecomment-588454552

## Changelog

[General] [Changed] - Use es6 import/export syntax for ScrollView component

Pull Request resolved: https://github.com/facebook/react-native/pull/29184

Test Plan:
Test on RNTester for iOS

currently having trouble starting up RNTester on Android, but will update when I'm able to check on Android

Reviewed By: TheSavior

Differential Revision: D22959782

Pulled By: PeteTheHeat

fbshipit-source-id: c909bddda3b5b2edd26a526eedaa67fadd4c2b51
2020-08-05 17:51:13 -07:00

58 lines
1.7 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 registerGeneratedViewConfig from '../../Utilities/registerGeneratedViewConfig';
import requireNativeComponent from '../../ReactNative/requireNativeComponent';
import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes';
import type {ScrollViewNativeProps} from './ScrollViewNativeComponentType';
const AndroidHorizontalScrollViewViewConfig = {
uiViewClassName: 'AndroidHorizontalScrollView',
bubblingEventTypes: {},
directEventTypes: {},
validAttributes: {
decelerationRate: true,
disableIntervalMomentum: true,
endFillColor: {process: require('../../StyleSheet/processColor')},
fadingEdgeLength: true,
nestedScrollEnabled: true,
overScrollMode: true,
pagingEnabled: true,
persistentScrollbar: true,
scrollEnabled: true,
scrollPerfTag: true,
sendMomentumEvents: true,
showsHorizontalScrollIndicator: true,
snapToEnd: true,
snapToInterval: true,
snapToStart: true,
snapToOffsets: true,
contentOffset: true,
},
};
let AndroidHorizontalScrollViewNativeComponent;
if (global.RN$Bridgeless) {
registerGeneratedViewConfig(
'AndroidHorizontalScrollView',
AndroidHorizontalScrollViewViewConfig,
);
AndroidHorizontalScrollViewNativeComponent = 'AndroidHorizontalScrollView';
} else {
AndroidHorizontalScrollViewNativeComponent = requireNativeComponent<ScrollViewNativeProps>(
'AndroidHorizontalScrollView',
);
}
export default ((AndroidHorizontalScrollViewNativeComponent: any): HostComponent<ScrollViewNativeProps>);