ReactNativeViewAttributes.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. * @flow strict-local
  8. * @format
  9. */
  10. 'use strict';
  11. const ReactNativeStyleAttributes = require('./ReactNativeStyleAttributes');
  12. const UIView = {
  13. pointerEvents: true,
  14. accessible: true,
  15. accessibilityActions: true,
  16. accessibilityLabel: true,
  17. accessibilityLiveRegion: true,
  18. accessibilityRole: true,
  19. accessibilityState: true,
  20. accessibilityValue: true,
  21. accessibilityHint: true,
  22. importantForAccessibility: true,
  23. nativeID: true,
  24. testID: true,
  25. renderToHardwareTextureAndroid: true,
  26. shouldRasterizeIOS: true,
  27. onLayout: true,
  28. onAccessibilityAction: true,
  29. onAccessibilityTap: true,
  30. onMagicTap: true,
  31. onAccessibilityEscape: true,
  32. collapsable: true,
  33. needsOffscreenAlphaCompositing: true,
  34. style: ReactNativeStyleAttributes,
  35. };
  36. const RCTView = {
  37. ...UIView,
  38. // This is a special performance property exposed by RCTView and useful for
  39. // scrolling content when there are many subviews, most of which are offscreen.
  40. // For this property to be effective, it must be applied to a view that contains
  41. // many subviews that extend outside its bound. The subviews must also have
  42. // overflow: hidden, as should the containing view (or one of its superviews).
  43. removeClippedSubviews: true,
  44. };
  45. const ReactNativeViewAttributes = {
  46. UIView: UIView,
  47. RCTView: RCTView,
  48. };
  49. module.exports = ReactNativeViewAttributes;