react-native-tvos 0.75.2-0rc1 → 0.75.3-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/Libraries/Components/Pressable/Pressable.js +5 -6
  2. package/Libraries/Components/ScrollView/ScrollView.d.ts +1 -1
  3. package/Libraries/Components/TV/TVEventHandler.js +11 -6
  4. package/Libraries/Components/TV/TVFocusEventHandler.js +2 -1
  5. package/Libraries/Components/TV/TVFocusGuideView.js +16 -15
  6. package/Libraries/Components/TV/TVTextScrollView.js +10 -9
  7. package/Libraries/Components/TV/TVViewPropTypes.js +1 -1
  8. package/Libraries/Components/TV/tagForComponentOrHandle.js +13 -13
  9. package/Libraries/Components/TV/useTVEventHandler.js +7 -3
  10. package/Libraries/Components/TabBarIOS/RCTTabBarNativeComponent.js +3 -2
  11. package/Libraries/Components/TabBarIOS/TabBarIOS.ios.js +6 -55
  12. package/Libraries/Components/TabBarIOS/{TabBarIOS.android.js → TabBarIOS.js} +8 -5
  13. package/Libraries/Components/TabBarIOS/TabBarIOSProps.js +52 -0
  14. package/Libraries/Components/TabBarIOS/{TabBarItemIOS.android.js → TabBarItemIOS.js} +3 -1
  15. package/Libraries/Components/Touchable/TVTouchable.js +6 -5
  16. package/Libraries/Components/Touchable/Touchable.js +2 -3
  17. package/Libraries/Components/Touchable/TouchableBounce.js +2 -5
  18. package/Libraries/Components/Touchable/TouchableHighlight.js +3 -4
  19. package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +3 -4
  20. package/Libraries/Core/ReactNativeVersion.js +2 -2
  21. package/Libraries/Debugging/DebuggingOverlayRegistry.js +1 -1
  22. package/Libraries/Debugging/useSubscribeToDebuggingOverlayRegistry.js +3 -1
  23. package/Libraries/NativeComponent/BaseViewConfig.android.js +1 -2
  24. package/Libraries/NativeComponent/BaseViewConfig.ios.js +1 -2
  25. package/Libraries/NativeComponent/TVViewConfig.js +4 -1
  26. package/Libraries/NewAppScreen/components/DebugInstructions.js +7 -7
  27. package/Libraries/NewAppScreen/components/HermesBadge.js +3 -6
  28. package/Libraries/Pressability/Pressability.js +6 -3
  29. package/Libraries/ReactNative/AppContainer-dev.js +4 -3
  30. package/Libraries/ReactNative/RendererImplementation.js +2 -2
  31. package/Libraries/Renderer/shims/ReactNativeTypes.js +1 -0
  32. package/Libraries/StyleSheet/StyleSheetTypes.d.ts +17 -15
  33. package/Libraries/Utilities/BackHandler.ios.js +25 -23
  34. package/Libraries/Utilities/Platform.d.ts +1 -0
  35. package/Libraries/Utilities/Platform.flow.js +2 -0
  36. package/Libraries/Vibration/Vibration.js +1 -1
  37. package/README-core.md +5 -5
  38. package/README.md +76 -41
  39. package/React/Base/RCTVersion.m +2 -2
  40. package/ReactAndroid/api/ReactAndroid.api +2 -2
  41. package/ReactAndroid/gradle.properties +1 -1
  42. package/ReactAndroid/publish.gradle +1 -1
  43. package/ReactAndroid/src/main/java/com/facebook/react/devsupport/CxxInspectorPackagerConnection.java +2 -4
  44. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +2 -2
  45. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/drawable/CSSBackgroundDrawable.java +9 -4
  46. package/ReactAndroid/src/main/java/com/facebook/react/views/imagehelper/ImageSource.kt +6 -4
  47. package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewManager.java +18 -0
  48. package/ReactAndroid/src/main/jni/react/devsupport/JCxxInspectorPackagerConnectionWebSocketDelegate.cpp +11 -2
  49. package/ReactAndroid/src/main/jni/react/devsupport/JCxxInspectorPackagerConnectionWebSocketDelegate.h +1 -3
  50. package/ReactCommon/cxxreact/ReactNativeVersion.h +2 -2
  51. package/ReactCommon/react/renderer/components/view/BaseViewProps.cpp +3 -3
  52. package/index.js +3 -3
  53. package/package.json +12 -11
  54. package/scripts/bundle.js +2 -0
  55. package/scripts/cocoapods/autolinking.rb +2 -1
  56. package/scripts/codegen/generate-artifacts-executor.js +3 -2
  57. package/scripts/hermes/hermes-utils.js +0 -1
  58. package/sdks/hermes-engine/utils/build-ios-framework.sh +2 -2
  59. package/sdks/hermesc/osx-bin/hermes +0 -0
  60. package/sdks/hermesc/osx-bin/hermesc +0 -0
  61. package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
  62. package/types/experimental.d.ts +1 -1
  63. package/types/public/ReactNativeTVTypes.d.ts +44 -3
  64. package/ReactAndroid/src/main/jni/react/devsupport/JOptional.cpp +0 -29
  65. package/ReactAndroid/src/main/jni/react/devsupport/JOptional.h +0 -27
@@ -4,11 +4,12 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * @flow strict-local
7
+ * @flow
8
8
  * @format
9
9
  */
10
10
 
11
11
  import type {
12
+ FocusEvent,
12
13
  LayoutEvent,
13
14
  MouseEvent,
14
15
  PressEvent,
@@ -27,7 +28,6 @@ import {type RectOrSize} from '../../StyleSheet/Rect';
27
28
  import useMergeRefs from '../../Utilities/useMergeRefs';
28
29
  import View from '../View/View';
29
30
  import type {TVParallaxPropertiesType} from '../TV/TVViewPropTypes';
30
- import Platform from '../../Utilities/Platform';
31
31
  import {tvFocusEventHandler} from '../TV/TVFocusEventHandler';
32
32
  import tagForComponentOrHandle from '../TV/tagForComponentOrHandle';
33
33
  import useAndroidRippleForView, {
@@ -332,13 +332,13 @@ function Pressable(
332
332
  delayPressIn: unstable_pressDelay,
333
333
  onHoverIn,
334
334
  onHoverOut,
335
- onBlur(event: HWEvent): void {
335
+ onBlur(event: FocusEvent): void {
336
336
  shouldUpdatePressed && setFocused(false);
337
337
  if (onBlur != null) {
338
338
  onBlur(event);
339
339
  }
340
340
  },
341
- onFocus(event: HWEvent): void {
341
+ onFocus(event: FocusEvent): void {
342
342
  shouldUpdatePressed && setFocused(true);
343
343
  if (onFocus != null) {
344
344
  onFocus(event);
@@ -393,7 +393,7 @@ function Pressable(
393
393
  const eventHandlers = usePressability(config);
394
394
 
395
395
  const pressableTVFocusEventHandler = React.useCallback(
396
- (evt: FocusEvent) => {
396
+ (evt: any) => {
397
397
  if (isTVSelectable !== false || focusable !== false) {
398
398
  // $FlowFixMe[prop-missing]
399
399
  if (evt?.eventType === 'focus') {
@@ -417,7 +417,6 @@ function Pressable(
417
417
  }
418
418
  },
419
419
  [
420
- focused,
421
420
  onBlur,
422
421
  onFocus,
423
422
  onLongPress,
@@ -534,7 +534,7 @@ export interface ScrollViewPropsIOS {
534
534
  * Defines if UIScrollView index should be shown when fast scrolling.
535
535
  * Defaults to true.
536
536
  */
537
- showsScrollIndex?: boolean;
537
+ showsScrollIndex?: boolean | undefined;
538
538
  }
539
539
 
540
540
  export interface ScrollViewPropsAndroid {
@@ -10,18 +10,23 @@
10
10
 
11
11
  'use strict';
12
12
 
13
+ import type {TVRemoteEvent} from '../../Types/CoreEventTypes';
14
+
15
+ import NativeTVNavigationEventEmitter from '../../../src/private/specs/modules/NativeTVNavigationEventEmitter';
13
16
  import NativeEventEmitter from '../../EventEmitter/NativeEventEmitter';
14
17
  import Platform from '../../Utilities/Platform';
15
18
  import {type EventSubscription} from '../../vendor/emitter/EventEmitter';
16
- import NativeTVNavigationEventEmitter from '../../../src/private/specs/modules/NativeTVNavigationEventEmitter';
17
- import type {TVRemoteEvent} from '../../Types/CoreEventTypes';
18
19
 
19
20
  let __nativeTVNavigationEventEmitter: ?NativeEventEmitter<TVRemoteEvent> = null;
20
21
 
21
- const TVEventHandler = {
22
- addListener: (callback: Function) => {
22
+ const TVEventHandler: {
23
+ addListener: (
24
+ callback: (event: any) => void,
25
+ ) => EventSubscription | {remove: () => void},
26
+ } = {
27
+ addListener: callback => {
23
28
  if (Platform.OS === 'ios' && !NativeTVNavigationEventEmitter) {
24
- return;
29
+ return {remove: () => {}};
25
30
  }
26
31
  if (!__nativeTVNavigationEventEmitter) {
27
32
  __nativeTVNavigationEventEmitter = new NativeEventEmitter<TVRemoteEvent>(
@@ -32,7 +37,7 @@ const TVEventHandler = {
32
37
  __nativeTVNavigationEventEmitter.addListener(
33
38
  // $FlowFixMe[prop-missing]
34
39
  'onHWKeyEvent',
35
- data => {
40
+ (data: any) => {
36
41
  if (callback) {
37
42
  callback(data);
38
43
  }
@@ -10,9 +10,10 @@
10
10
 
11
11
  'use strict';
12
12
 
13
+ import type {TVRemoteEvent} from '../../Types/CoreEventTypes';
14
+
13
15
  import Platform from '../../Utilities/Platform';
14
16
  import {type EventSubscription} from '../../vendor/emitter/EventEmitter';
15
- import type {TVRemoteEvent} from '../../Types/CoreEventTypes';
16
17
  import TVEventHandler from './TVEventHandler';
17
18
 
18
19
  class TVFocusEventHandler {
@@ -10,14 +10,15 @@
10
10
 
11
11
  import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes';
12
12
  import type {ViewProps} from '../View/ViewPropTypes';
13
+ import type {ComponentOrHandleType} from './tagForComponentOrHandle';
13
14
 
14
15
  import setAndForwardRef from '../../Utilities/setAndForwardRef';
15
16
  import {Commands} from '../View/ViewNativeComponent';
17
+ import tagForComponentOrHandle from './tagForComponentOrHandle';
16
18
 
19
+ const StyleSheet = require('../../StyleSheet/StyleSheet');
20
+ const View = require('../View/View');
17
21
  const React = require('react');
18
- const ReactNative = require('react-native');
19
-
20
- const {View} = ReactNative;
21
22
 
22
23
  type TVFocusGuideViewProps = $ReadOnly<{
23
24
  ...ViewProps,
@@ -32,7 +33,7 @@ type TVFocusGuideViewProps = $ReadOnly<{
32
33
  /**
33
34
  * The views the focus should go to
34
35
  */
35
- destinations?: (?React.ElementRef<HostComponent<mixed>>)[],
36
+ destinations?: ComponentOrHandleType[],
36
37
 
37
38
  /**
38
39
  * @deprecated Don't use it, no longer necessary.
@@ -49,7 +50,7 @@ type TVFocusGuideViewProps = $ReadOnly<{
49
50
  /**
50
51
  * When set to false, this view and all its subviews will be NOT focusable.
51
52
  */
52
- focusable?: boolean | undefined,
53
+ focusable?: boolean | void,
53
54
  }>;
54
55
 
55
56
  export type TVFocusGuideViewImperativeMethods = $ReadOnly<{
@@ -67,16 +68,16 @@ function TVFocusGuideView(
67
68
  focusable,
68
69
  ...props
69
70
  }: TVFocusGuideViewProps,
70
- forwardedRef,
71
+ forwardedRef: any,
71
72
  ): React.Node {
72
- const focusGuideRef = React.useRef<React.ElementRef<
73
- typeof ReactNative.View,
74
- > | null>(null);
73
+ const focusGuideRef = React.useRef<React.ElementRef<typeof View> | null>(
74
+ null,
75
+ );
75
76
 
76
77
  const setDestinations = React.useCallback(
77
- (destinations: (?React.ElementRef<HostComponent<mixed>>)[]) => {
78
+ (destinations: ?(ComponentOrHandleType[])) => {
78
79
  const dests: number[] = (destinations || [])
79
- .map(ReactNative.findNodeHandle)
80
+ .map((destination: any) => tagForComponentOrHandle(destination))
80
81
  .filter(Boolean);
81
82
 
82
83
  if (focusGuideRef.current != null) {
@@ -106,8 +107,8 @@ function TVFocusGuideView(
106
107
  });
107
108
 
108
109
  React.useEffect(() => {
109
- if (destinationsProp != null) {
110
- setDestinations(destinationsProp);
110
+ if (destinationsProp !== null && destinationsProp !== undefined) {
111
+ setDestinations(destinationsProp); // $FlowFixMe[incompatible-call]
111
112
  }
112
113
  }, [setDestinations, destinationsProp]);
113
114
 
@@ -121,7 +122,7 @@ function TVFocusGuideView(
121
122
 
122
123
  return (
123
124
  // $FlowFixMe[prop-missing]
124
- <ReactNative.View
125
+ <View
125
126
  {...props}
126
127
  style={style}
127
128
  ref={_setNativeRef}
@@ -135,7 +136,7 @@ function TVFocusGuideView(
135
136
  );
136
137
  }
137
138
 
138
- const styles = ReactNative.StyleSheet.create({
139
+ const styles = StyleSheet.create({
139
140
  container: {
140
141
  minWidth: 1,
141
142
  minHeight: 1,
@@ -5,15 +5,16 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  * @format
8
- * @flow strict-local
8
+ * @flow
9
9
  */
10
10
 
11
- const React = require('react');
12
- const ScrollView = require('../ScrollView/ScrollView');
13
- const {tvFocusEventHandler} = require('./TVFocusEventHandler');
11
+ import typeof Props from '../ScrollView/ScrollView';
14
12
 
15
13
  import tagForComponentOrHandle from './tagForComponentOrHandle';
16
- import typeof Props from '../ScrollView/ScrollView';
14
+
15
+ const ScrollView = require('../ScrollView/ScrollView');
16
+ const {tvFocusEventHandler} = require('./TVFocusEventHandler');
17
+ const React = require('react');
17
18
 
18
19
  /**
19
20
  * Convenience wrapper to create a scroll view that will scroll correctly
@@ -64,9 +65,9 @@ class TVTextScrollView extends React.Component<{
64
65
  _subscription: any;
65
66
 
66
67
  componentDidMount() {
67
- const cmp = this;
68
- const myTag = tagForComponentOrHandle(cmp);
69
- tvFocusEventHandler.register(myTag, function (evt) {
68
+ const cmp = this; // eslint-disable-line consistent-this
69
+ const myTag = tagForComponentOrHandle(this);
70
+ tvFocusEventHandler?.register(myTag, function (evt) {
70
71
  if (myTag === evt.tag) {
71
72
  if (evt.eventType === 'focus') {
72
73
  cmp.props.onFocus && cmp.props.onFocus(evt);
@@ -79,7 +80,7 @@ class TVTextScrollView extends React.Component<{
79
80
 
80
81
  componentWillUnmount() {
81
82
  const myTag = tagForComponentOrHandle(this);
82
- tvFocusEventHandler.unregister(myTag);
83
+ tvFocusEventHandler?.unregister(myTag);
83
84
  }
84
85
 
85
86
  render(): React.Node | React.Element<string> {
@@ -83,6 +83,6 @@ export type TVViewProps = $ReadOnly<{|
83
83
  */
84
84
  destinations?: ?(Object[]),
85
85
  enabled?: boolean,
86
- autofocus?: boolean,
86
+ autoFocus?: boolean,
87
87
  safePadding?: string | null,
88
88
  |}>;
@@ -1,24 +1,24 @@
1
- // Replacement for findNodeHandle, since we need this for converting
2
- // components to tags when rendering nextFocus props
3
- // @flow
1
+ /*
2
+ * Replacement for findNodeHandle, since we need this for converting
3
+ * components to tags when rendering nextFocus props
4
+ * @flow
5
+ */
4
6
 
5
7
  // TODO: make this work for Fabric
6
8
 
9
+ import type {ElementRef, ElementType} from 'react';
10
+
7
11
  const findNodeHandle = require('../../ReactNative/RendererProxy').findNodeHandle;
8
12
 
9
- type TagForComponentOrHandleType = (
10
- component: ?(
11
- | {_nativeTag: ?number, canonical: ?{_nativeTag: ?number}}
12
- | number
13
- ),
13
+ export type ComponentOrHandleType = ?(ElementRef<ElementType> | number);
14
+
15
+ export type TagForComponentOrHandleType = (
16
+ component: ComponentOrHandleType,
14
17
  ) => ?number;
15
18
 
16
19
  const tagForComponentOrHandle: TagForComponentOrHandleType = (
17
- component: ?(
18
- | {_nativeTag: ?number, canonical: ?{_nativeTag: ?number}}
19
- | number
20
- ),
21
- ): ?number => {
20
+ component
21
+ ) => {
22
22
  if (component === null || component === undefined) {
23
23
  return undefined;
24
24
  }
@@ -1,8 +1,12 @@
1
- // @flow
2
- import React from 'react';
3
- import TVEventHandler from './TVEventHandler';
1
+ /*
2
+ * @flow
3
+ */
4
+
4
5
  import type {TVRemoteEvent} from '../../Types/CoreEventTypes';
6
+
5
7
  import {type EventSubscription} from '../../vendor/emitter/EventEmitter';
8
+ import TVEventHandler from './TVEventHandler';
9
+ import React from 'react';
6
10
 
7
11
 
8
12
  const useTVEventHandler = (handleEvent: (evt: TVRemoteEvent) => void) => {
@@ -5,12 +5,13 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  * @format
8
- * @flow
8
+ * @noflow
9
9
  */
10
10
 
11
11
  'use strict';
12
12
 
13
- const requireNativeComponent = require('../../ReactNative/requireNativeComponent').default;
13
+ const requireNativeComponent =
14
+ require('../../ReactNative/requireNativeComponent').default;
14
15
 
15
16
  import type {ViewProps} from '../View/ViewPropTypes';
16
17
  import type {ColorValue} from '../../StyleSheet/StyleSheetTypes';
@@ -5,70 +5,21 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  * @format
8
- * @flow
8
+ * @noflow
9
9
  */
10
10
 
11
11
  'use strict';
12
12
 
13
- const React = require('react');
14
- const StyleSheet = require('../../StyleSheet/StyleSheet');
15
- const TabBarItemIOS = require('./TabBarItemIOS');
13
+ import type {TabBarIOSProps} from './TabBarIOSProps';
16
14
 
15
+ const StyleSheet = require('../../StyleSheet/StyleSheet');
17
16
  const RCTTabBar = require('./RCTTabBarNativeComponent');
18
-
19
- import type {ViewProps} from '../View/ViewPropTypes';
20
- import type {ColorValue} from '../../StyleSheet/StyleSheetTypes';
21
-
22
- type Props = $ReadOnly<{|
23
- ...ViewProps,
24
-
25
- /**
26
- * Color of text on unselected tabs
27
- */
28
- unselectedTintColor?: ColorValue,
29
-
30
- /**
31
- * Color of the currently selected tab icon
32
- */
33
- tintColor?: ColorValue,
34
-
35
- /**
36
- * Color of unselected tab icons. Available since iOS 10.
37
- */
38
- unselectedItemTintColor?: ColorValue,
39
-
40
- /**
41
- * Background color of the tab bar
42
- */
43
- barTintColor?: ColorValue,
44
-
45
- /**
46
- * The style of the tab bar. Supported values are 'default', 'black'.
47
- * Use 'black' instead of setting `barTintColor` to black. This produces
48
- * a tab bar with the native iOS style with higher translucency.
49
- */
50
- barStyle?: ?('default' | 'black'),
51
-
52
- /**
53
- * A Boolean value that indicates whether the tab bar is translucent
54
- */
55
- translucent?: ?boolean,
56
-
57
- /**
58
- * Specifies tab bar item positioning. Available values are:
59
- * - fill - distributes items across the entire width of the tab bar
60
- * - center - centers item in the available tab bar space
61
- * - auto (default) - distributes items dynamically according to the
62
- * user interface idiom. In a horizontally compact environment (e.g. iPhone 5)
63
- * this value defaults to `fill`, in a horizontally regular one (e.g. iPad)
64
- * it defaults to center.
65
- */
66
- itemPositioning?: ?('fill' | 'center' | 'auto'),
67
- |}>;
17
+ const TabBarItemIOS = require('./TabBarItemIOS');
18
+ const React = require('react');
68
19
 
69
20
  let showedDeprecationWarning = true;
70
21
 
71
- class TabBarIOS extends React.Component<Props> {
22
+ class TabBarIOS extends React.Component<TabBarIOSProps> {
72
23
  static Item: React.Node = TabBarItemIOS;
73
24
 
74
25
  componentDidMount() {
@@ -10,15 +10,18 @@
10
10
 
11
11
  'use strict';
12
12
 
13
+ import type {TabBarIOSProps} from './TabBarIOSProps';
14
+
13
15
  import React from 'react';
16
+
14
17
  const StyleSheet = require('../../StyleSheet/StyleSheet');
15
- const TabBarItemIOS = require('./TabBarItemIOS');
16
18
  const View = require('../View/View');
19
+ const TabBarItemIOS = require('./TabBarItemIOS');
17
20
 
18
21
  let showedDeprecationWarning = false;
19
22
 
20
- class DummyTabBarIOS extends React.Component<$FlowFixMeProps> {
21
- static Item = TabBarItemIOS;
23
+ class TabBarIOS extends React.Component<TabBarIOSProps> {
24
+ static Item: any = TabBarItemIOS;
22
25
 
23
26
  componentDidMount() {
24
27
  if (!showedDeprecationWarning) {
@@ -31,7 +34,7 @@ class DummyTabBarIOS extends React.Component<$FlowFixMeProps> {
31
34
  }
32
35
  }
33
36
 
34
- render() {
37
+ render(): React.Node {
35
38
  return (
36
39
  <View style={[this.props.style, styles.tabGroup]}>
37
40
  {this.props.children}
@@ -46,4 +49,4 @@ const styles = StyleSheet.create({
46
49
  },
47
50
  });
48
51
 
49
- module.exports = DummyTabBarIOS;
52
+ module.exports = TabBarIOS;
@@ -0,0 +1,52 @@
1
+ /*
2
+ * @flow
3
+ */
4
+
5
+ import type { ViewProps } from '../View/ViewPropTypes';
6
+
7
+ export type TabBarIOSProps = $ReadOnly<{|
8
+ ...ViewProps,
9
+
10
+ /**
11
+ * Color of text on unselected tabs
12
+ */
13
+ unselectedTintColor?: string,
14
+
15
+ /**
16
+ * Color of the currently selected tab icon
17
+ */
18
+ tintColor?: string,
19
+
20
+ /**
21
+ * Color of unselected tab icons. Available since iOS 10.
22
+ */
23
+ unselectedItemTintColor?: string,
24
+
25
+ /**
26
+ * Background color of the tab bar
27
+ */
28
+ barTintColor?: string,
29
+
30
+ /**
31
+ * The style of the tab bar. Supported values are 'default', 'black'.
32
+ * Use 'black' instead of setting `barTintColor` to black. This produces
33
+ * a tab bar with the native iOS style with higher translucency.
34
+ */
35
+ barStyle?: ?('default' | 'black'),
36
+
37
+ /**
38
+ * A Boolean value that indicates whether the tab bar is translucent
39
+ */
40
+ translucent?: ?boolean,
41
+
42
+ /**
43
+ * Specifies tab bar item positioning. Available values are:
44
+ * - fill - distributes items across the entire width of the tab bar
45
+ * - center - centers item in the available tab bar space
46
+ * - auto (default) - distributes items dynamically according to the
47
+ * user interface idiom. In a horizontally compact environment (e.g. iPhone 5)
48
+ * this value defaults to `fill`, in a horizontally regular one (e.g. iPad)
49
+ * it defaults to center.
50
+ */
51
+ itemPositioning?: ?('fill' | 'center' | 'auto'),
52
+ |}>;
@@ -5,13 +5,15 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  * @format
8
+ * @noflow
8
9
  */
9
10
 
10
11
  'use strict';
11
12
 
12
13
  import React from 'react';
13
- const View = require('../View/View');
14
+
14
15
  const StyleSheet = require('../../StyleSheet/StyleSheet');
16
+ const View = require('../View/View');
15
17
 
16
18
  let showedDeprecationWarning = false;
17
19
 
@@ -10,15 +10,16 @@
10
10
 
11
11
  'use strict';
12
12
 
13
- import invariant from 'invariant';
14
- import tagForComponentOrHandle from '../TV/tagForComponentOrHandle';
15
13
  import type {
16
14
  BlurEvent,
17
15
  FocusEvent,
18
16
  PressEvent,
19
17
  } from '../../Types/CoreEventTypes';
18
+
20
19
  import Platform from '../../Utilities/Platform';
20
+ import tagForComponentOrHandle from '../TV/tagForComponentOrHandle';
21
21
  import {tvFocusEventHandler} from '../TV/TVFocusEventHandler';
22
+ import invariant from 'invariant';
22
23
 
23
24
  type TVTouchableConfig = $ReadOnly<{|
24
25
  getDisabled: () => boolean,
@@ -38,9 +39,9 @@ export default class TVTouchable {
38
39
  if (!Platform.isTV) {
39
40
  return;
40
41
  }
41
- const _tvtouchable = this;
42
+ const _tvtouchable = this; // eslint-disable-line consistent-this
42
43
  this._viewTag = tagForComponentOrHandle(component);
43
- tvFocusEventHandler.register(this._viewTag, tvData => {
44
+ tvFocusEventHandler?.register(this._viewTag, tvData => {
44
45
  if (!_tvtouchable._enabled) {
45
46
  return;
46
47
  }
@@ -65,6 +66,6 @@ export default class TVTouchable {
65
66
 
66
67
  destroy(): void {
67
68
  this._enabled = false;
68
- tvFocusEventHandler.unregister(this._viewTag);
69
+ tvFocusEventHandler?.unregister(this._viewTag);
69
70
  }
70
71
  }
@@ -12,16 +12,15 @@ import type {EdgeInsetsProp} from '../../StyleSheet/EdgeInsetsPropType';
12
12
  import type {ColorValue} from '../../StyleSheet/StyleSheet';
13
13
  import type {PressEvent} from '../../Types/CoreEventTypes';
14
14
 
15
- import ReactNative from '../../Renderer/shims/ReactNative';
16
15
  import {PressabilityDebugView} from '../../Pressability/PressabilityDebug';
17
16
  import UIManager from '../../ReactNative/UIManager';
18
17
  import Platform from '../../Utilities/Platform';
19
18
  import SoundManager from '../Sound/SoundManager';
19
+ import tagForComponentOrHandle from '../TV/tagForComponentOrHandle';
20
20
  import {tvFocusEventHandler} from '../TV/TVFocusEventHandler';
21
21
  import BoundingDimensions from './BoundingDimensions';
22
22
  import Position from './Position';
23
23
  import * as React from 'react';
24
- import tagForComponentOrHandle from '../TV/tagForComponentOrHandle';
25
24
 
26
25
  const extractSingleTouch = (nativeEvent: {
27
26
  +changedTouches: $ReadOnlyArray<PressEvent['nativeEvent']>,
@@ -374,7 +373,7 @@ const LONG_PRESS_ALLOWED_MOVEMENT = 10;
374
373
  * @lends Touchable.prototype
375
374
  */
376
375
  const TouchableMixin = {
377
- componentDidMount: function () {
376
+ componentDidMount: function (this: any) {
378
377
  if (!Platform.isTV) {
379
378
  return;
380
379
  }
@@ -16,8 +16,8 @@ import Pressability, {
16
16
  type PressabilityConfig,
17
17
  } from '../../Pressability/Pressability';
18
18
  import {PressabilityDebugView} from '../../Pressability/PressabilityDebug';
19
- import TVTouchable from './TVTouchable';
20
19
  import Platform from '../../Utilities/Platform';
20
+ import TVTouchable from './TVTouchable';
21
21
  import * as React from 'react';
22
22
 
23
23
  type Props = $ReadOnly<{|
@@ -228,13 +228,10 @@ class TouchableBounce extends React.Component<Props, State> {
228
228
  },
229
229
  });
230
230
  }
231
- }
232
-
233
- componentDidUpdate(prevProps: Props, prevState: State) {
234
231
  this.state.pressability.configure(this._createPressabilityConfig());
235
232
  }
236
233
 
237
- componentDidMount(): mixed {
234
+ componentDidUpdate(prevProps: Props, prevState: State) {
238
235
  this.state.pressability.configure(this._createPressabilityConfig());
239
236
  }
240
237
 
@@ -9,6 +9,7 @@
9
9
  */
10
10
 
11
11
  import type {ColorValue} from '../../StyleSheet/StyleSheet';
12
+ import type {TVParallaxPropertiesType} from '../TV/TVViewPropTypes';
12
13
  import typeof TouchableWithoutFeedback from './TouchableWithoutFeedback';
13
14
 
14
15
  import View from '../../Components/View/View';
@@ -17,10 +18,9 @@ import Pressability, {
17
18
  } from '../../Pressability/Pressability';
18
19
  import {PressabilityDebugView} from '../../Pressability/PressabilityDebug';
19
20
  import StyleSheet, {type ViewStyleProp} from '../../StyleSheet/StyleSheet';
20
- import TVTouchable from './TVTouchable';
21
21
  import Platform from '../../Utilities/Platform';
22
- import type {TVParallaxPropertiesType} from '../TV/TVViewPropTypes';
23
22
  import tagForComponentOrHandle from '../TV/tagForComponentOrHandle';
23
+ import TVTouchable from './TVTouchable';
24
24
  import * as React from 'react';
25
25
 
26
26
  type AndroidProps = $ReadOnly<{|
@@ -46,8 +46,7 @@ type Props = $ReadOnly<{|
46
46
  ...React.ElementConfig<TouchableWithoutFeedback>,
47
47
  ...AndroidProps,
48
48
  ...TVProps,
49
- ...ViewProps,
50
-
49
+ //...ViewProps,
51
50
  activeOpacity?: ?number,
52
51
  underlayColor?: ?ColorValue,
53
52
  style?: ?ViewStyleProp,
@@ -8,7 +8,6 @@
8
8
  * @format
9
9
  */
10
10
 
11
- import type {TVParallaxPropertiesType} from '../TV/TVViewPropTypes';
12
11
  import type {
13
12
  AccessibilityActionEvent,
14
13
  AccessibilityActionInfo,
@@ -23,14 +22,14 @@ import type {
23
22
  LayoutEvent,
24
23
  PressEvent,
25
24
  } from '../../Types/CoreEventTypes';
26
- import {Platform} from '../../Utilities/Platform';
25
+ import type {TVParallaxPropertiesType} from '../TV/TVViewPropTypes';
27
26
 
28
27
  import View from '../../Components/View/View';
29
28
  import {PressabilityDebugView} from '../../Pressability/PressabilityDebug';
30
29
  import usePressability from '../../Pressability/usePressability';
30
+ import useTVEventHandler from '../TV/useTVEventHandler';
31
31
  import * as React from 'react';
32
32
  import {useMemo} from 'react';
33
- import useTVEventHandler from '../TV/useTVEventHandler';
34
33
 
35
34
  type Props = $ReadOnly<{|
36
35
  accessibilityActions?: ?$ReadOnlyArray<AccessibilityActionInfo>,
@@ -204,7 +203,7 @@ module.exports = function TouchableWithoutFeedback(props: Props): React.Node {
204
203
  eventHandlers || {};
205
204
 
206
205
  useTVEventHandler(evt => {
207
- if (props.disabled || props.ariaDisabled) {
206
+ if (props.disabled === true || props['aria-disabled'] === true) {
208
207
  return;
209
208
  }
210
209
  if (evt.eventType === 'focus') {