ScrollViewNativeComponent.js 952 B

1234567891011121314151617181920212223242526272829303132
  1. /**
  2. * Copyright (c) Facebook, Inc. and its 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. * @format
  8. * @flow
  9. */
  10. 'use strict';
  11. const registerGeneratedViewConfig = require('../../Utilities/registerGeneratedViewConfig');
  12. const requireNativeComponent = require('../../ReactNative/requireNativeComponent');
  13. import ScrollViewViewConfig from './ScrollViewViewConfig';
  14. import type {
  15. ScrollViewNativeProps,
  16. ScrollViewNativeComponentType,
  17. } from './ScrollViewNativeComponentType';
  18. let ScrollViewNativeComponent;
  19. if (global.RN$Bridgeless) {
  20. registerGeneratedViewConfig('RCTScrollView', ScrollViewViewConfig);
  21. ScrollViewNativeComponent = 'RCTScrollView';
  22. } else {
  23. ScrollViewNativeComponent = requireNativeComponent<ScrollViewNativeProps>(
  24. 'RCTScrollView',
  25. );
  26. }
  27. export default ((ScrollViewNativeComponent: any): ScrollViewNativeComponentType);