react-native-tvos 0.77.0-0rc1 → 0.77.0-0rc5

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 (42) hide show
  1. package/Libraries/Animated/animations/Animation.js +1 -1
  2. package/Libraries/Components/Pressable/Pressable.d.ts +2 -2
  3. package/Libraries/Components/Pressable/Pressable.js +3 -3
  4. package/Libraries/Components/ScrollView/ScrollView.js +3 -2
  5. package/Libraries/Components/TV/TVFocusGuideView.js +2 -5
  6. package/Libraries/Components/TextInput/TextInput.js +1 -1
  7. package/Libraries/Components/Touchable/TouchableNativeFeedback.js +1 -1
  8. package/Libraries/Components/Touchable/TouchableOpacity.js +1 -2
  9. package/Libraries/Components/View/View.js +2 -3
  10. package/Libraries/Components/View/ViewNativeComponent.js +2 -2
  11. package/Libraries/Core/ReactNativeVersion.js +1 -1
  12. package/Libraries/LogBox/LogBoxNotificationContainer.js +1 -1
  13. package/Libraries/LogBox/UI/LogBoxButton.js +2 -2
  14. package/Libraries/LogBox/UI/LogBoxNotification.js +1 -1
  15. package/Libraries/Utilities/BackHandler.ios.js +3 -8
  16. package/Libraries/Utilities/setAndForwardRef.js +2 -2
  17. package/React/Base/RCTVersion.m +1 -1
  18. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +4 -9
  19. package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +11 -1
  20. package/ReactAndroid/api/ReactAndroid.api +2 -0
  21. package/ReactAndroid/cmake-utils/default-app-setup/OnLoad.cpp +0 -13
  22. package/ReactAndroid/gradle.properties +2 -2
  23. package/ReactAndroid/src/main/java/com/facebook/react/HeadlessJsTaskService.java +12 -13
  24. package/ReactAndroid/src/main/java/com/facebook/react/devsupport/StackTraceHelper.java +6 -2
  25. package/ReactAndroid/src/main/java/com/facebook/react/module/model/ReactModuleInfo.kt +18 -0
  26. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
  27. package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactClippingViewManager.kt +0 -3
  28. package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.java +32 -0
  29. package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
  30. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.mm +2 -0
  31. package/ReactCommon/react/runtime/ReactInstance.cpp +39 -35
  32. package/ReactCommon/react/runtime/ReactInstance.h +2 -1
  33. package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm +3 -2
  34. package/index.js +5 -5
  35. package/package.json +8 -8
  36. package/scripts/cocoapods/utils.rb +6 -6
  37. package/scripts/codegen/generate-artifacts-executor.js +10 -0
  38. package/sdks/hermes-engine/hermes-engine.podspec +1 -1
  39. package/sdks/hermesc/osx-bin/hermes +0 -0
  40. package/sdks/hermesc/osx-bin/hermesc +0 -0
  41. package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
  42. package/types/public/ReactNativeTVTypes.d.ts +9 -7
@@ -165,7 +165,7 @@ export default class Animation {
165
165
  const callback = this.#onEnd;
166
166
  if (callback != null) {
167
167
  this.#onEnd = null;
168
- queueMicrotask(() => callback(result));
168
+ callback(result);
169
169
  }
170
170
  }
171
171
  }
@@ -20,7 +20,7 @@ import {
20
20
  import {View} from '../View/View';
21
21
  import {AccessibilityProps} from '../View/ViewAccessibility';
22
22
  import {ViewProps} from '../View/ViewPropTypes';
23
- import {TVParallaxProperties} from '../../../types/public/ReactNativeTVTypes';
23
+ import {TVParallaxProperties} from '../../../types/index';
24
24
 
25
25
  export interface PressableStateCallbackType {
26
26
  readonly pressed: boolean;
@@ -166,7 +166,7 @@ export interface PressableProps
166
166
  *
167
167
  * @platform ios
168
168
  */
169
- tvParallaxProperties?: TVParallaxProperties;
169
+ tvParallaxProperties?: TVParallaxProperties | undefined;
170
170
  }
171
171
 
172
172
  // TODO use React.AbstractComponent when available
@@ -9,12 +9,13 @@
9
9
  */
10
10
 
11
11
  import type {
12
- FocusEvent,
13
12
  BlurEvent,
13
+ FocusEvent,
14
14
  LayoutEvent,
15
15
  MouseEvent,
16
16
  PressEvent,
17
17
  } from '../../Types/CoreEventTypes';
18
+ import type {TVParallaxPropertiesType} from '../TV/TVViewPropTypes';
18
19
  import type {
19
20
  AccessibilityActionEvent,
20
21
  AccessibilityActionInfo,
@@ -27,9 +28,8 @@ import {PressabilityDebugView} from '../../Pressability/PressabilityDebug';
27
28
  import usePressability from '../../Pressability/usePressability';
28
29
  import {type RectOrSize} from '../../StyleSheet/Rect';
29
30
  import useMergeRefs from '../../Utilities/useMergeRefs';
30
- import View from '../View/View';
31
- import type {TVParallaxPropertiesType} from '../TV/TVViewPropTypes';
32
31
  import tagForComponentOrHandle from '../TV/tagForComponentOrHandle';
32
+ import View from '../View/View';
33
33
  import useAndroidRippleForView, {
34
34
  type RippleConfig,
35
35
  } from './useAndroidRippleForView';
@@ -1921,5 +1921,6 @@ Wrapper.displayName = 'ScrollView';
1921
1921
  // $FlowExpectedError[prop-missing]
1922
1922
  Wrapper.Context = ScrollViewContext;
1923
1923
 
1924
- module.exports = ((Wrapper: $FlowFixMe): typeof Wrapper &
1925
- ScrollViewComponentStatics);
1924
+ //module.exports = ((Wrapper: $FlowFixMe): typeof Wrapper &
1925
+ // ScrollViewComponentStatics);
1926
+ module.exports = ((Wrapper: $FlowFixMe): $FlowFixMe);
@@ -55,7 +55,7 @@ type TVFocusGuideViewProps = $ReadOnly<{
55
55
 
56
56
  export type TVFocusGuideViewImperativeMethods = $ReadOnly<{
57
57
  setDestinations: (
58
- destinations: (?React.ElementRef<HostComponent<mixed>>)[],
58
+ destinations: ComponentOrHandleType[],
59
59
  ) => void,
60
60
  }>;
61
61
 
@@ -143,10 +143,7 @@ const styles = StyleSheet.create({
143
143
  },
144
144
  });
145
145
 
146
- const ForwardedTVFocusGuideView: React.AbstractComponent<
147
- TVFocusGuideViewProps,
148
- React.ElementRef<typeof View> & TVFocusGuideViewImperativeMethods,
149
- > = React.forwardRef(TVFocusGuideView);
146
+ const ForwardedTVFocusGuideView: $FlowFixMe = React.forwardRef(TVFocusGuideView);
150
147
  ForwardedTVFocusGuideView.displayName = 'TVFocusGuideView';
151
148
 
152
149
  module.exports = ForwardedTVFocusGuideView;
@@ -20,7 +20,6 @@ import type {TextInputType} from './TextInput.flow';
20
20
 
21
21
  import * as ReactNativeFeatureFlags from '../../../src/private/featureflags/ReactNativeFeatureFlags';
22
22
  import usePressability from '../../Pressability/usePressability';
23
- import warnOnce from '../../Utilities/warnOnce';
24
23
  import flattenStyle from '../../StyleSheet/flattenStyle';
25
24
  import StyleSheet, {
26
25
  type ColorValue,
@@ -31,6 +30,7 @@ import Text from '../../Text/Text';
31
30
  import TextAncestor from '../../Text/TextAncestor';
32
31
  import Platform from '../../Utilities/Platform';
33
32
  import useMergeRefs from '../../Utilities/useMergeRefs';
33
+ import warnOnce from '../../Utilities/warnOnce';
34
34
  import TextInputState from './TextInputState';
35
35
  import invariant from 'invariant';
36
36
  import nullthrows from 'nullthrows';
@@ -18,8 +18,8 @@ import Pressability, {
18
18
  import {PressabilityDebugView} from '../../Pressability/PressabilityDebug';
19
19
  import {findHostInstance_DEPRECATED} from '../../ReactNative/RendererProxy';
20
20
  import processColor from '../../StyleSheet/processColor';
21
- import tagForComponentOrHandle from '../TV/tagForComponentOrHandle';
22
21
  import Platform from '../../Utilities/Platform';
22
+ import tagForComponentOrHandle from '../TV/tagForComponentOrHandle';
23
23
  import {Commands} from '../View/ViewNativeComponent';
24
24
  import invariant from 'invariant';
25
25
  import * as React from 'react';
@@ -9,6 +9,7 @@
9
9
  */
10
10
 
11
11
  import type {ViewStyleProp} from '../../StyleSheet/StyleSheet';
12
+ import type {TVParallaxPropertiesType} from '../TV/TVViewPropTypes';
12
13
  import typeof TouchableWithoutFeedback from './TouchableWithoutFeedback';
13
14
 
14
15
  import Animated from '../../Animated/Animated';
@@ -19,9 +20,7 @@ import Pressability, {
19
20
  import {PressabilityDebugView} from '../../Pressability/PressabilityDebug';
20
21
  import flattenStyle from '../../StyleSheet/flattenStyle';
21
22
  import Platform from '../../Utilities/Platform';
22
- import type {TVParallaxPropertiesType} from '../TV/TVViewPropTypes';
23
23
  import tagForComponentOrHandle from '../TV/tagForComponentOrHandle';
24
-
25
24
  import * as React from 'react';
26
25
 
27
26
  type TVProps = $ReadOnly<{|
@@ -11,11 +11,10 @@
11
11
  import type {ViewProps} from './ViewPropTypes';
12
12
 
13
13
  import TextAncestor from '../../Text/TextAncestor';
14
+ import setAndForwardRef from '../../Utilities/setAndForwardRef';
14
15
  import ViewNativeComponent from './ViewNativeComponent';
15
- import * as React from 'react';
16
16
  import {Commands} from './ViewNativeComponent';
17
-
18
- import setAndForwardRef from '../../Utilities/setAndForwardRef';
17
+ import * as React from 'react';
19
18
 
20
19
  export type Props = ViewProps;
21
20
 
@@ -27,10 +27,10 @@ interface NativeCommands {
27
27
  +setPressed: (viewRef: HostInstance, pressed: boolean) => void;
28
28
  // Focus Guide API
29
29
  +setDestinations: (
30
- viewRef: React.ElementRef<HostComponent<mixed>>,
30
+ viewRef: $FlowFixMe,
31
31
  destinations: Array<number>, // Node handles are basically integers
32
32
  ) => void;
33
- +requestTVFocus: (viewRef: React.ElementRef<HostComponent<mixed>>) => void;
33
+ +requestTVFocus: (viewRef: $FlowFixMe) => void;
34
34
  }
35
35
 
36
36
  export const Commands: NativeCommands = codegenNativeCommands<NativeCommands>({
@@ -17,7 +17,7 @@ const version: $ReadOnly<{
17
17
  major: 0,
18
18
  minor: 77,
19
19
  patch: 0,
20
- prerelease: '0rc1',
20
+ prerelease: '0rc5',
21
21
  };
22
22
 
23
23
  module.exports = {version};
@@ -10,8 +10,8 @@
10
10
 
11
11
  import SafeAreaView from '../../src/private/components/SafeAreaView_INTERNAL_DO_NOT_USE';
12
12
  import View from '../Components/View/View';
13
- import Platform from '../Utilities/Platform';
14
13
  import StyleSheet from '../StyleSheet/StyleSheet';
14
+ import Platform from '../Utilities/Platform';
15
15
  import * as LogBoxData from './Data/LogBoxData';
16
16
  import LogBoxLog from './Data/LogBoxLog';
17
17
  import LogBoxLogNotification from './UI/LogBoxNotification';
@@ -12,11 +12,11 @@ import type {EdgeInsetsProp} from '../../StyleSheet/EdgeInsetsPropType';
12
12
  import type {ViewStyleProp} from '../../StyleSheet/StyleSheet';
13
13
  import type {PressEvent} from '../../Types/CoreEventTypes';
14
14
 
15
- import TouchableWithoutFeedback from '../../Components/Touchable/TouchableWithoutFeedback';
16
15
  import TouchableHighlight from '../../Components/Touchable/TouchableHighlight';
17
- import Platform from '../../Utilities/Platform';
16
+ import TouchableWithoutFeedback from '../../Components/Touchable/TouchableWithoutFeedback';
18
17
  import View from '../../Components/View/View';
19
18
  import StyleSheet from '../../StyleSheet/StyleSheet';
19
+ import Platform from '../../Utilities/Platform';
20
20
  import * as LogBoxStyle from './LogBoxStyle';
21
21
  import * as React from 'react';
22
22
 
@@ -9,8 +9,8 @@
9
9
  */
10
10
 
11
11
  import View from '../../Components/View/View';
12
- import Platform from '../../Utilities/Platform';
13
12
  import StyleSheet from '../../StyleSheet/StyleSheet';
13
+ import Platform from '../../Utilities/Platform';
14
14
  import * as LogBoxData from '../Data/LogBoxData';
15
15
  import LogBoxLog from '../Data/LogBoxLog';
16
16
  import LogBoxButton from './LogBoxButton';
@@ -103,16 +103,11 @@ if (Platform.isTV) {
103
103
  ): {remove: () => void, ...} {
104
104
  _backPressSubscriptions.add(_handler);
105
105
  return {
106
- remove: () => BackHandler.removeEventListener(_eventName, _handler),
106
+ remove: (): void => {
107
+ _backPressSubscriptions.delete(_handler);
108
+ },
107
109
  };
108
110
  },
109
-
110
- removeEventListener: function (
111
- _eventName: BackPressEventName,
112
- _handler: () => ?boolean,
113
- ) {
114
- _backPressSubscriptions.delete(_handler);
115
- },
116
111
  };
117
112
  }
118
113
 
@@ -10,10 +10,10 @@
10
10
 
11
11
  'use strict';
12
12
 
13
- import type {ElementRef, Ref} from 'react';
13
+ import type {ElementRef} from 'react';
14
14
 
15
15
  type Args = $ReadOnly<{|
16
- getForwardedRef: () => ?Ref<any>,
16
+ getForwardedRef: () => ?ElementRef<any>,
17
17
  setLocalRef: (ref: ElementRef<any>) => mixed,
18
18
  |}>;
19
19
 
@@ -24,7 +24,7 @@ NSDictionary* RCTGetReactNativeVersion(void)
24
24
  RCTVersionMajor: @(0),
25
25
  RCTVersionMinor: @(77),
26
26
  RCTVersionPatch: @(0),
27
- RCTVersionPrerelease: @"0rc1",
27
+ RCTVersionPrerelease: @"0rc5",
28
28
  };
29
29
  });
30
30
  return __rnVersion;
@@ -201,10 +201,11 @@ RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrollView, NSInt
201
201
 
202
202
  UIEdgeInsets newEdgeInsets = _scrollView.contentInset;
203
203
  CGFloat inset = MAX(scrollViewLowerY - keyboardEndFrame.origin.y, 0);
204
+ const auto &props = static_cast<const ScrollViewProps &>(*_props);
204
205
  if (isInverted) {
205
- newEdgeInsets.top = MAX(inset, _scrollView.contentInset.top);
206
+ newEdgeInsets.top = MAX(inset, props.contentInset.top);
206
207
  } else {
207
- newEdgeInsets.bottom = MAX(inset, _scrollView.contentInset.bottom);
208
+ newEdgeInsets.bottom = MAX(inset, props.contentInset.bottom);
208
209
  }
209
210
 
210
211
  CGPoint newContentOffset = _scrollView.contentOffset;
@@ -222,12 +223,6 @@ RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrollView, NSInt
222
223
  contentDiff = keyboardEndFrame.origin.y - keyboardBeginFrame.origin.y;
223
224
  }
224
225
  } else {
225
- CGRect viewIntersection = CGRectIntersection(self.firstResponderFocus, keyboardEndFrame);
226
-
227
- if (CGRectIsNull(viewIntersection)) {
228
- return;
229
- }
230
-
231
226
  // Inner text field focused
232
227
  CGFloat focusEnd = CGRectGetMaxY(self.firstResponderFocus);
233
228
  if (focusEnd > keyboardEndFrame.origin.y) {
@@ -259,7 +254,7 @@ RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrollView, NSInt
259
254
  animations:^{
260
255
  self->_scrollView.contentInset = newEdgeInsets;
261
256
  self->_scrollView.verticalScrollIndicatorInsets = newEdgeInsets;
262
- [self scrollToOffset:newContentOffset animated:NO];
257
+ [self scrollTo:newContentOffset.x y:newContentOffset.y animated:NO];
263
258
  }
264
259
  completion:nil];
265
260
  }
@@ -68,6 +68,8 @@ static NSSet<NSNumber *> *returnKeyTypesSet;
68
68
  * later comparison insensitive to them.
69
69
  */
70
70
  NSDictionary<NSAttributedStringKey, id> *_originalTypingAttributes;
71
+
72
+ BOOL _hasInputAccessoryView;
71
73
  }
72
74
 
73
75
  #pragma mark - UIView overrides
@@ -99,9 +101,11 @@ static NSSet<NSNumber *> *returnKeyTypesSet;
99
101
  NSMutableDictionary<NSAttributedStringKey, id> *defaultAttributes =
100
102
  [_backedTextInputView.defaultTextAttributes mutableCopy];
101
103
 
104
+ #if !TARGET_OS_MACCATALYST
102
105
  RCTWeakEventEmitterWrapper *eventEmitterWrapper = [RCTWeakEventEmitterWrapper new];
103
106
  eventEmitterWrapper.eventEmitter = _eventEmitter;
104
107
  defaultAttributes[RCTAttributedStringEventEmitterKey] = eventEmitterWrapper;
108
+ #endif
105
109
 
106
110
  _backedTextInputView.defaultTextAttributes = defaultAttributes;
107
111
  }
@@ -262,8 +266,10 @@ static NSSet<NSNumber *> *returnKeyTypesSet;
262
266
  if (newTextInputProps.textAttributes != oldTextInputProps.textAttributes) {
263
267
  NSMutableDictionary<NSAttributedStringKey, id> *defaultAttributes =
264
268
  RCTNSTextAttributesFromTextAttributes(newTextInputProps.getEffectiveTextAttributes(RCTFontSizeMultiplier()));
269
+ #if !TARGET_OS_MACCATALYST
265
270
  defaultAttributes[RCTAttributedStringEventEmitterKey] =
266
271
  _backedTextInputView.defaultTextAttributes[RCTAttributedStringEventEmitterKey];
272
+ #endif
267
273
  _backedTextInputView.defaultTextAttributes = defaultAttributes;
268
274
  }
269
275
 
@@ -609,10 +615,12 @@ static NSSet<NSNumber *> *returnKeyTypesSet;
609
615
  keyboardType == UIKeyboardTypeDecimalPad || keyboardType == UIKeyboardTypeASCIICapableNumberPad) &&
610
616
  (containsKeyType || containsInputAccessoryViewButtonLabel);
611
617
 
612
- if ((_backedTextInputView.inputAccessoryView != nil) == shouldHaveInputAccessoryView) {
618
+ if (_hasInputAccessoryView == shouldHaveInputAccessoryView) {
613
619
  return;
614
620
  }
615
621
 
622
+ _hasInputAccessoryView = shouldHaveInputAccessoryView;
623
+
616
624
  #if !TARGET_OS_TV
617
625
  if (shouldHaveInputAccessoryView) {
618
626
  NSString *buttonLabel = inputAccessoryViewButtonLabel != nil ? inputAccessoryViewButtonLabel
@@ -641,6 +649,8 @@ static NSSet<NSNumber *> *returnKeyTypesSet;
641
649
 
642
650
  - (void)handleInputAccessoryDoneButton
643
651
  {
652
+ // Ignore the value of whether we submitted; just make sure the submit event is called if necessary.
653
+ [self textInputShouldSubmitOnReturn];
644
654
  if ([self textInputShouldReturn]) {
645
655
  [_backedTextInputView endEditing:YES];
646
656
  }
@@ -2963,6 +2963,7 @@ public abstract interface annotation class com/facebook/react/module/annotations
2963
2963
  public final class com/facebook/react/module/model/ReactModuleInfo {
2964
2964
  public static final field Companion Lcom/facebook/react/module/model/ReactModuleInfo$Companion;
2965
2965
  public fun <init> (Ljava/lang/String;Ljava/lang/String;ZZZZ)V
2966
+ public fun <init> (Ljava/lang/String;Ljava/lang/String;ZZZZZ)V
2966
2967
  public final fun canOverrideExistingModule ()Z
2967
2968
  public static final fun classIsTurboModule (Ljava/lang/Class;)Z
2968
2969
  public final fun className ()Ljava/lang/String;
@@ -7835,6 +7836,7 @@ public class com/facebook/react/views/view/ReactViewGroup : android/view/ViewGro
7835
7836
  protected fun dispatchSetPressed (Z)V
7836
7837
  public fun draw (Landroid/graphics/Canvas;)V
7837
7838
  protected fun drawChild (Landroid/graphics/Canvas;Landroid/view/View;J)Z
7839
+ public fun endViewTransition (Landroid/view/View;)V
7838
7840
  protected fun getChildDrawingOrder (II)I
7839
7841
  public fun getClippingRect (Landroid/graphics/Rect;)V
7840
7842
  public fun getHitSlopRect ()Landroid/graphics/Rect;
@@ -29,12 +29,7 @@
29
29
 
30
30
  #include <DefaultComponentsRegistry.h>
31
31
  #include <DefaultTurboModuleManagerDelegate.h>
32
- #if __has_include("<autolinking.h>")
33
- #define AUTOLINKING_AVAILABLE 1
34
32
  #include <autolinking.h>
35
- #else
36
- #define AUTOLINKING_AVAILABLE 0
37
- #endif
38
33
  #include <fbjni/fbjni.h>
39
34
  #include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
40
35
  #include <rncore.h>
@@ -61,10 +56,8 @@ void registerComponents(
61
56
  REACT_NATIVE_APP_COMPONENT_REGISTRATION(registry);
62
57
  #endif
63
58
 
64
- #if AUTOLINKING_AVAILABLE
65
59
  // And we fallback to the components autolinked
66
60
  autolinking_registerProviders(registry);
67
- #endif
68
61
  }
69
62
 
70
63
  std::shared_ptr<TurboModule> cxxModuleProvider(
@@ -78,12 +71,8 @@ std::shared_ptr<TurboModule> cxxModuleProvider(
78
71
  // return std::make_shared<NativeCxxModuleExample>(jsInvoker);
79
72
  // }
80
73
 
81
- #if AUTOLINKING_AVAILABLE
82
74
  // And we fallback to the CXX module providers autolinked
83
75
  return autolinking_cxxModuleProvider(name, jsInvoker);
84
- #endif
85
-
86
- return nullptr;
87
76
  }
88
77
 
89
78
  std::shared_ptr<TurboModule> javaModuleProvider(
@@ -112,12 +101,10 @@ std::shared_ptr<TurboModule> javaModuleProvider(
112
101
  return module;
113
102
  }
114
103
 
115
- #if AUTOLINKING_AVAILABLE
116
104
  // And we fallback to the module providers autolinked
117
105
  if (auto module = autolinking_ModuleProvider(name, params)) {
118
106
  return module;
119
107
  }
120
- #endif
121
108
 
122
109
  return nullptr;
123
110
  }
@@ -1,5 +1,5 @@
1
- VERSION_NAME=0.77.0-0rc1
2
- react.internal.publishingGroup=io.github.react-native-tvos
1
+ VERSION_NAME=0.77.0-0rc5
2
+ react.internal.publishingGroup=com.facebook.react
3
3
 
4
4
  android.useAndroidX=true
5
5
 
@@ -179,31 +179,30 @@ public abstract class HeadlessJsTaskService extends Service implements HeadlessJ
179
179
  }
180
180
 
181
181
  private void createReactContextAndScheduleTask(final HeadlessJsTaskConfig taskConfig) {
182
- final ReactHost reactHost = getReactHost();
183
-
184
- if (reactHost == null) { // old arch
185
- final ReactInstanceManager reactInstanceManager =
186
- getReactNativeHost().getReactInstanceManager();
187
-
188
- reactInstanceManager.addReactInstanceEventListener(
182
+ if (ReactNativeFeatureFlags.enableBridgelessArchitecture()) {
183
+ final ReactHost reactHost = getReactHost();
184
+ reactHost.addReactInstanceEventListener(
189
185
  new ReactInstanceEventListener() {
190
186
  @Override
191
187
  public void onReactContextInitialized(@NonNull ReactContext reactContext) {
192
188
  invokeStartTask(reactContext, taskConfig);
193
- reactInstanceManager.removeReactInstanceEventListener(this);
189
+ reactHost.removeReactInstanceEventListener(this);
194
190
  }
195
191
  });
196
- reactInstanceManager.createReactContextInBackground();
197
- } else { // new arch
198
- reactHost.addReactInstanceEventListener(
192
+ reactHost.start();
193
+ } else {
194
+ final ReactInstanceManager reactInstanceManager =
195
+ getReactNativeHost().getReactInstanceManager();
196
+
197
+ reactInstanceManager.addReactInstanceEventListener(
199
198
  new ReactInstanceEventListener() {
200
199
  @Override
201
200
  public void onReactContextInitialized(@NonNull ReactContext reactContext) {
202
201
  invokeStartTask(reactContext, taskConfig);
203
- reactHost.removeReactInstanceEventListener(this);
202
+ reactInstanceManager.removeReactInstanceEventListener(this);
204
203
  }
205
204
  });
206
- reactHost.start();
205
+ reactInstanceManager.createReactContextInBackground();
207
206
  }
208
207
  }
209
208
  }
@@ -268,8 +268,12 @@ public class StackTraceHelper {
268
268
  List<ReadableMap> readableMapList = new ArrayList<>();
269
269
  for (ParsedError.StackFrame frame : frames) {
270
270
  JavaOnlyMap map = new JavaOnlyMap();
271
- map.putDouble(COLUMN_KEY, frame.getColumn());
272
- map.putDouble(LINE_NUMBER_KEY, frame.getLineNumber());
271
+ if (frame.getColumn() != null) {
272
+ map.putDouble(COLUMN_KEY, frame.getColumn());
273
+ }
274
+ if (frame.getLineNumber() != null) {
275
+ map.putDouble(LINE_NUMBER_KEY, frame.getLineNumber());
276
+ }
273
277
  map.putString(FILE_KEY, (String) frame.getFile());
274
278
  map.putString(METHOD_NAME_KEY, (String) frame.getMethodName());
275
279
  readableMapList.add(map);
@@ -21,6 +21,24 @@ public class ReactModuleInfo(
21
21
  public val isCxxModule: Boolean,
22
22
  public val isTurboModule: Boolean
23
23
  ) {
24
+
25
+ @Deprecated(
26
+ "This constructor is deprecated and will be removed in the future. Use ReactModuleInfo(String, String, boolean, boolean, boolean, boolean)]",
27
+ replaceWith =
28
+ ReplaceWith(
29
+ expression =
30
+ "ReactModuleInfo(name, className, canOverrideExistingModule, needsEagerInit, isCxxModule, isTurboModule)"),
31
+ level = DeprecationLevel.WARNING)
32
+ public constructor(
33
+ name: String,
34
+ className: String,
35
+ canOverrideExistingModule: Boolean,
36
+ needsEagerInit: Boolean,
37
+ @Suppress("UNUSED_PARAMETER") hasConstants: Boolean,
38
+ isCxxModule: Boolean,
39
+ isTurboModule: Boolean
40
+ ) : this(name, className, canOverrideExistingModule, needsEagerInit, isCxxModule, isTurboModule)
41
+
24
42
  public companion object {
25
43
  /**
26
44
  * Checks if the passed class is a TurboModule. Useful to populate the parameter [isTurboModule]
@@ -18,5 +18,5 @@ public class ReactNativeVersion {
18
18
  "major", 0,
19
19
  "minor", 77,
20
20
  "patch", 0,
21
- "prerelease", "0rc1");
21
+ "prerelease", "0rc5");
22
22
  }
@@ -62,9 +62,6 @@ public abstract class ReactClippingViewManager<T : ReactViewGroup> : ViewGroupMa
62
62
  if (removeClippedSubviews) {
63
63
  val child = getChildAt(parent, index)
64
64
  if (child != null) {
65
- if (child.parent != null) {
66
- parent.removeView(child)
67
- }
68
65
  parent.removeViewWithSubviewClippingEnabled(child)
69
66
  }
70
67
  } else {
@@ -77,6 +77,8 @@ import com.facebook.react.uimanager.style.BorderRadiusProp;
77
77
  import com.facebook.react.uimanager.style.BorderStyle;
78
78
  import com.facebook.react.uimanager.style.LogicalEdge;
79
79
  import com.facebook.react.uimanager.style.Overflow;
80
+ import java.util.HashSet;
81
+ import java.util.Set;
80
82
 
81
83
  import java.lang.ref.WeakReference;
82
84
  import java.util.ArrayList;
@@ -170,6 +172,7 @@ public class ReactViewGroup extends ViewGroup
170
172
  private @Nullable ViewGroupDrawingOrderHelper mDrawingOrderHelper;
171
173
  private float mBackfaceOpacity;
172
174
  private String mBackfaceVisibility;
175
+ private @Nullable Set<Integer> mChildrenRemovedWhileTransitioning;
173
176
 
174
177
  /**
175
178
  * Creates a new `ReactViewGroup` instance.
@@ -203,6 +206,7 @@ public class ReactViewGroup extends ViewGroup
203
206
  mDrawingOrderHelper = null;
204
207
  mBackfaceOpacity = 1.f;
205
208
  mBackfaceVisibility = "visible";
209
+ mChildrenRemovedWhileTransitioning = null;
206
210
  }
207
211
 
208
212
  /* package */ void recycleView() {
@@ -387,6 +391,7 @@ public class ReactViewGroup extends ViewGroup
387
391
  return;
388
392
  }
389
393
  mRemoveClippedSubviews = removeClippedSubviews;
394
+ mChildrenRemovedWhileTransitioning = null;
390
395
  if (removeClippedSubviews) {
391
396
  mClippingRect = new Rect();
392
397
  ReactClippingViewGroupHelper.calculateClippingRect(this, mClippingRect);
@@ -440,6 +445,26 @@ public class ReactViewGroup extends ViewGroup
440
445
  updateClippingToRect(mClippingRect);
441
446
  }
442
447
 
448
+ @Override
449
+ public void endViewTransition(View view) {
450
+ super.endViewTransition(view);
451
+ if (mChildrenRemovedWhileTransitioning != null) {
452
+ mChildrenRemovedWhileTransitioning.remove(view.getId());
453
+ }
454
+ }
455
+
456
+ private void trackChildViewTransition(int childId) {
457
+ if (mChildrenRemovedWhileTransitioning == null) {
458
+ mChildrenRemovedWhileTransitioning = new HashSet<>();
459
+ }
460
+ mChildrenRemovedWhileTransitioning.add(childId);
461
+ }
462
+
463
+ private boolean isChildRemovedWhileTransitioning(View child) {
464
+ return mChildrenRemovedWhileTransitioning != null
465
+ && mChildrenRemovedWhileTransitioning.contains(child.getId());
466
+ }
467
+
443
468
  private void updateClippingToRect(Rect clippingRect) {
444
469
  Assertions.assertNotNull(mAllChildren);
445
470
  int clippedSoFar = 0;
@@ -670,6 +695,12 @@ public class ReactViewGroup extends ViewGroup
670
695
  } else {
671
696
  setChildrenDrawingOrderEnabled(false);
672
697
  }
698
+
699
+ // The parent might not be null in case the child is transitioning.
700
+ if (child.getParent() != null) {
701
+ trackChildViewTransition(child.getId());
702
+ }
703
+
673
704
  super.onViewRemoved(child);
674
705
  }
675
706
 
@@ -799,6 +830,7 @@ public class ReactViewGroup extends ViewGroup
799
830
  }
800
831
  }
801
832
  removeViewsInLayout(index - clippedSoFar, 1);
833
+ invalidate();
802
834
  }
803
835
  removeFromArray(index);
804
836
  }
@@ -18,7 +18,7 @@ constexpr struct {
18
18
  int32_t Major = 0;
19
19
  int32_t Minor = 77;
20
20
  int32_t Patch = 0;
21
- std::string_view Prerelease = "0rc1";
21
+ std::string_view Prerelease = "0rc5";
22
22
  } ReactNativeVersion;
23
23
 
24
24
  } // namespace facebook::react
@@ -407,6 +407,7 @@ static NSMutableAttributedString *RCTNSAttributedStringFragmentWithAttributesFro
407
407
  {
408
408
  auto nsAttributedStringFragment = RCTNSAttributedStringFragmentFromFragment(fragment, placeholderImage);
409
409
 
410
+ #if !TARGET_OS_MACCATALYST
410
411
  if (fragment.parentShadowView.componentHandle) {
411
412
  RCTWeakEventEmitterWrapper *eventEmitterWrapper = [RCTWeakEventEmitterWrapper new];
412
413
  eventEmitterWrapper.eventEmitter = fragment.parentShadowView.eventEmitter;
@@ -417,6 +418,7 @@ static NSMutableAttributedString *RCTNSAttributedStringFragmentWithAttributesFro
417
418
  [nsAttributedStringFragment addAttributes:additionalTextAttributes
418
419
  range:NSMakeRange(0, nsAttributedStringFragment.length)];
419
420
  }
421
+ #endif
420
422
 
421
423
  return nsAttributedStringFragment;
422
424
  }
@@ -236,47 +236,51 @@ std::string simpleBasename(const std::string& path) {
236
236
  */
237
237
  void ReactInstance::loadScript(
238
238
  std::unique_ptr<const JSBigString> script,
239
- const std::string& sourceURL) {
239
+ const std::string& sourceURL,
240
+ std::function<void(jsi::Runtime& runtime)>&& completion) {
240
241
  auto buffer = std::make_shared<BigStringBuffer>(std::move(script));
241
242
  std::string scriptName = simpleBasename(sourceURL);
242
243
 
243
- runtimeScheduler_->scheduleWork(
244
- [this,
245
- scriptName,
246
- sourceURL,
247
- buffer = std::move(buffer),
248
- weakBufferedRuntimeExecuter = std::weak_ptr<BufferedRuntimeExecutor>(
249
- bufferedRuntimeExecutor_)](jsi::Runtime& runtime) {
250
- SystraceSection s("ReactInstance::loadScript");
251
- bool hasLogger(ReactMarker::logTaggedMarkerBridgelessImpl);
252
- if (hasLogger) {
253
- ReactMarker::logTaggedMarkerBridgeless(
254
- ReactMarker::RUN_JS_BUNDLE_START, scriptName.c_str());
255
- }
244
+ runtimeScheduler_->scheduleWork([this,
245
+ scriptName,
246
+ sourceURL,
247
+ buffer = std::move(buffer),
248
+ weakBufferedRuntimeExecuter =
249
+ std::weak_ptr<BufferedRuntimeExecutor>(
250
+ bufferedRuntimeExecutor_),
251
+ completion](jsi::Runtime& runtime) {
252
+ SystraceSection s("ReactInstance::loadScript");
253
+ bool hasLogger(ReactMarker::logTaggedMarkerBridgelessImpl);
254
+ if (hasLogger) {
255
+ ReactMarker::logTaggedMarkerBridgeless(
256
+ ReactMarker::RUN_JS_BUNDLE_START, scriptName.c_str());
257
+ }
256
258
 
257
- runtime.evaluateJavaScript(buffer, sourceURL);
259
+ runtime.evaluateJavaScript(buffer, sourceURL);
258
260
 
259
- /**
260
- * TODO(T183610671): We need a safe/reliable way to enable the js
261
- * pipeline from javascript. Remove this after we figure that out, or
262
- * after we just remove the js pipeline.
263
- */
264
- if (!jsErrorHandler_->hasHandledFatalError()) {
265
- jsErrorHandler_->setRuntimeReady();
266
- }
261
+ /**
262
+ * TODO(T183610671): We need a safe/reliable way to enable the js
263
+ * pipeline from javascript. Remove this after we figure that out, or
264
+ * after we just remove the js pipeline.
265
+ */
266
+ if (!jsErrorHandler_->hasHandledFatalError()) {
267
+ jsErrorHandler_->setRuntimeReady();
268
+ }
267
269
 
268
- if (hasLogger) {
269
- ReactMarker::logTaggedMarkerBridgeless(
270
- ReactMarker::RUN_JS_BUNDLE_STOP, scriptName.c_str());
271
- ReactMarker::logMarkerBridgeless(
272
- ReactMarker::INIT_REACT_RUNTIME_STOP);
273
- ReactMarker::logMarkerBridgeless(ReactMarker::APP_STARTUP_STOP);
274
- }
275
- if (auto strongBufferedRuntimeExecuter =
276
- weakBufferedRuntimeExecuter.lock()) {
277
- strongBufferedRuntimeExecuter->flush();
278
- }
279
- });
270
+ if (hasLogger) {
271
+ ReactMarker::logTaggedMarkerBridgeless(
272
+ ReactMarker::RUN_JS_BUNDLE_STOP, scriptName.c_str());
273
+ ReactMarker::logMarkerBridgeless(ReactMarker::INIT_REACT_RUNTIME_STOP);
274
+ ReactMarker::logMarkerBridgeless(ReactMarker::APP_STARTUP_STOP);
275
+ }
276
+ if (auto strongBufferedRuntimeExecuter =
277
+ weakBufferedRuntimeExecuter.lock()) {
278
+ strongBufferedRuntimeExecuter->flush();
279
+ }
280
+ if (completion) {
281
+ completion(runtime);
282
+ }
283
+ });
280
284
  }
281
285
 
282
286
  /*
@@ -49,7 +49,8 @@ class ReactInstance final : private jsinspector_modern::InstanceTargetDelegate {
49
49
 
50
50
  void loadScript(
51
51
  std::unique_ptr<const JSBigString> script,
52
- const std::string& sourceURL);
52
+ const std::string& sourceURL,
53
+ std::function<void(jsi::Runtime& runtime)>&& completion = nullptr);
53
54
 
54
55
  void registerSegment(uint32_t segmentId, const std::string& segmentPath);
55
56
 
@@ -472,8 +472,9 @@ void RCTInstanceSetRuntimeDiagnosticFlags(NSString *flags)
472
472
 
473
473
  auto script = std::make_unique<NSDataBigString>(source.data);
474
474
  const auto *url = deriveSourceURL(source.url).UTF8String;
475
- _reactInstance->loadScript(std::move(script), url);
476
- [[NSNotificationCenter defaultCenter] postNotificationName:@"RCTInstanceDidLoadBundle" object:nil];
475
+ _reactInstance->loadScript(std::move(script), url, [](jsi::Runtime &_) {
476
+ [[NSNotificationCenter defaultCenter] postNotificationName:@"RCTInstanceDidLoadBundle" object:nil];
477
+ });
477
478
  }
478
479
 
479
480
  - (void)_handleJSError:(const JsErrorHandler::ParsedError &)error withRuntime:(jsi::Runtime &)runtime
package/index.js CHANGED
@@ -43,6 +43,11 @@ import typeof TouchableHighlight from './Libraries/Components/Touchable/Touchabl
43
43
  import typeof TouchableNativeFeedback from './Libraries/Components/Touchable/TouchableNativeFeedback';
44
44
  import typeof TouchableOpacity from './Libraries/Components/Touchable/TouchableOpacity';
45
45
  import typeof TouchableWithoutFeedback from './Libraries/Components/Touchable/TouchableWithoutFeedback';
46
+ import typeof TVEventControl from './Libraries/Components/TV/TVEventControl';
47
+ import typeof TVEventHandler from './Libraries/Components/TV/TVEventHandler';
48
+ import typeof TVFocusGuideView from './Libraries/Components/TV/TVFocusGuideView';
49
+ import typeof TVTextScrollView from './Libraries/Components/TV/TVTextScrollView';
50
+ import typeof useTVEventHandler from './Libraries/Components/TV/useTVEventHandler';
46
51
  import typeof View from './Libraries/Components/View/View';
47
52
  import typeof RegisterCallableModule from './Libraries/Core/registerCallableModule';
48
53
  import typeof NativeEventEmitter from './Libraries/EventEmitter/NativeEventEmitter';
@@ -92,13 +97,8 @@ import typeof DevSettings from './Libraries/Utilities/DevSettings';
92
97
  import typeof Dimensions from './Libraries/Utilities/Dimensions';
93
98
  import typeof PixelRatio from './Libraries/Utilities/PixelRatio';
94
99
  import typeof Platform from './Libraries/Utilities/Platform';
95
- import typeof TVEventHandler from './Libraries/Components/TV/TVEventHandler';
96
- import typeof TVFocusGuideView from './Libraries/Components/TV/TVFocusGuideView';
97
- import typeof TVEventControl from './Libraries/Components/TV/TVEventControl';
98
- import typeof TVTextScrollView from './Libraries/Components/TV/TVTextScrollView';
99
100
  import typeof useColorScheme from './Libraries/Utilities/useColorScheme';
100
101
  import typeof useWindowDimensions from './Libraries/Utilities/useWindowDimensions';
101
- import typeof useTVEventHandler from './Libraries/Components/TV/useTVEventHandler';
102
102
  import typeof Vibration from './Libraries/Vibration/Vibration';
103
103
  import typeof YellowBox from './Libraries/YellowBox/YellowBoxDeprecated';
104
104
  import typeof DevMenu from './src/private/devmenu/DevMenu';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-tvos",
3
- "version": "0.77.0-0rc1",
3
+ "version": "0.77.0-0rc5",
4
4
  "description": "A framework for building native apps using React",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -109,13 +109,13 @@
109
109
  },
110
110
  "dependencies": {
111
111
  "@jest/create-cache-key-function": "^29.6.3",
112
- "@react-native/assets-registry": "0.77.0-rc.1",
113
- "@react-native/codegen": "0.77.0-rc.1",
114
- "@react-native/community-cli-plugin": "0.77.0-rc.1",
115
- "@react-native/gradle-plugin": "0.77.0-rc.1",
116
- "@react-native/js-polyfills": "0.77.0-rc.1",
117
- "@react-native/normalize-colors": "0.77.0-rc.1",
118
- "@react-native-tvos/virtualized-lists": "0.77.0-0rc1",
112
+ "@react-native/assets-registry": "0.77.0-rc.5",
113
+ "@react-native/codegen": "0.77.0-rc.5",
114
+ "@react-native/community-cli-plugin": "0.77.0-rc.5",
115
+ "@react-native/gradle-plugin": "0.77.0-rc.5",
116
+ "@react-native/js-polyfills": "0.77.0-rc.5",
117
+ "@react-native/normalize-colors": "0.77.0-rc.5",
118
+ "@react-native-tvos/virtualized-lists": "0.77.0-0rc5",
119
119
  "abort-controller": "^3.0.0",
120
120
  "anser": "^1.4.9",
121
121
  "ansi-regex": "^5.0.0",
@@ -44,10 +44,10 @@ class ReactNativePodsUtils
44
44
  end
45
45
 
46
46
  def self.set_gcc_preprocessor_definition_for_React_hermes(installer)
47
- self.add_build_settings_to_pod(installer, "GCC_PREPROCESSOR_DEFINITIONS", "HERMES_ENABLE_DEBUGGER=1", "React-hermes", "Debug")
48
- self.add_build_settings_to_pod(installer, "GCC_PREPROCESSOR_DEFINITIONS", "HERMES_ENABLE_DEBUGGER=1", "React-jsinspector", "Debug")
49
- self.add_build_settings_to_pod(installer, "GCC_PREPROCESSOR_DEFINITIONS", "HERMES_ENABLE_DEBUGGER=1", "hermes-engine", "Debug")
50
- self.add_build_settings_to_pod(installer, "GCC_PREPROCESSOR_DEFINITIONS", "HERMES_ENABLE_DEBUGGER=1", "React-RuntimeHermes", "Debug")
47
+ self.add_build_settings_to_pod(installer, "GCC_PREPROCESSOR_DEFINITIONS", "HERMES_ENABLE_DEBUGGER=1", "React-hermes", :debug)
48
+ self.add_build_settings_to_pod(installer, "GCC_PREPROCESSOR_DEFINITIONS", "HERMES_ENABLE_DEBUGGER=1", "React-jsinspector", :debug)
49
+ self.add_build_settings_to_pod(installer, "GCC_PREPROCESSOR_DEFINITIONS", "HERMES_ENABLE_DEBUGGER=1", "hermes-engine", :debug)
50
+ self.add_build_settings_to_pod(installer, "GCC_PREPROCESSOR_DEFINITIONS", "HERMES_ENABLE_DEBUGGER=1", "React-RuntimeHermes", :debug)
51
51
  end
52
52
 
53
53
  def self.turn_off_resource_bundle_react_core(installer)
@@ -193,11 +193,11 @@ class ReactNativePodsUtils
193
193
 
194
194
  private
195
195
 
196
- def self.add_build_settings_to_pod(installer, settings_name, settings_value, target_pod_name, configuration)
196
+ def self.add_build_settings_to_pod(installer, settings_name, settings_value, target_pod_name, configuration_type)
197
197
  installer.target_installation_results.pod_target_installation_results.each do |pod_name, target_installation_result|
198
198
  if pod_name.to_s == target_pod_name
199
199
  target_installation_result.native_target.build_configurations.each do |config|
200
- if configuration == nil || (configuration != nil && config.name.include?(configuration))
200
+ if configuration_type == nil || (configuration_type != nil && config.type == configuration_type)
201
201
  config.build_settings[settings_name] ||= '$(inherited) '
202
202
  config.build_settings[settings_name] << settings_value
203
203
  end
@@ -764,6 +764,16 @@ function findFilesWithExtension(filePath, extension) {
764
764
  const dir = fs.readdirSync(filePath);
765
765
  dir.forEach(file => {
766
766
  const absolutePath = path.join(filePath, file);
767
+ // Exclude files provided by react-native
768
+ if (absolutePath.includes(`${path.sep}react-native${path.sep}`)) {
769
+ return null;
770
+ }
771
+
772
+ // Skip hidden folders, that starts with `.`
773
+ if (absolutePath.includes(`${path.sep}.`)) {
774
+ return null;
775
+ }
776
+
767
777
  if (
768
778
  fs.existsSync(absolutePath) &&
769
779
  fs.statSync(absolutePath).isDirectory()
@@ -9,7 +9,7 @@ require_relative "./hermes-utils.rb"
9
9
  begin
10
10
  react_native_path = File.dirname(Pod::Executable.execute_command('node', ['-p',
11
11
  'require.resolve(
12
- "react-native-tvos",
12
+ "react-native",
13
13
  {paths: [process.argv[1]]},
14
14
  )', __dir__]).strip
15
15
  )
Binary file
Binary file
Binary file
@@ -2,6 +2,8 @@ import * as React from 'react';
2
2
  import type { View, ScrollViewProps, HostComponent, EventSubscription } from 'react-native';
3
3
 
4
4
  declare module 'react-native' {
5
+ export type FocusDestination = null | number | React.Component<any, any> | React.ComponentClass<any>;
6
+
5
7
  interface ViewProps {
6
8
  /**
7
9
  * Android TV only prop
@@ -10,29 +12,29 @@ declare module 'react-native' {
10
12
  /**
11
13
  * TV next focus down (see documentation for the View component).
12
14
  */
13
- nextFocusDown?: number | undefined,
15
+ nextFocusDown?: FocusDestination | undefined,
14
16
 
15
17
  /**
16
18
  * TV next focus forward (see documentation for the View component).
17
19
  *
18
20
  * @platform android
19
21
  */
20
- nextFocusForward?: number | undefined,
22
+ nextFocusForward?: FocusDestination | undefined,
21
23
 
22
24
  /**
23
25
  * TV next focus left (see documentation for the View component).
24
26
  */
25
- nextFocusLeft?: number | undefined,
27
+ nextFocusLeft?: FocusDestination | undefined,
26
28
 
27
29
  /**
28
30
  * TV next focus right (see documentation for the View component).
29
31
  */
30
- nextFocusRight?: number | undefined,
32
+ nextFocusRight?: FocusDestination | undefined,
31
33
 
32
34
  /**
33
35
  * TV next focus up (see documentation for the View component).
34
36
  */
35
- nextFocusUp?: number | undefined,
37
+ nextFocusUp?: FocusDestination | undefined,
36
38
  }
37
39
 
38
40
  export interface NativeMethods {
@@ -118,7 +120,7 @@ declare module 'react-native' {
118
120
  /**
119
121
  * Array of `Component`s to register as destinations with `UIFocusGuide`
120
122
  */
121
- destinations?: (null | number | React.Component<any, any> | React.ComponentClass<any>)[] | undefined;
123
+ destinations?: FocusDestination[] | undefined;
122
124
  /**
123
125
  * If true, `TVFocusGuide` will automatically manage focus for you.
124
126
  * It will redirect the focus to the first focusable child on the first visit.
@@ -154,7 +156,7 @@ declare module 'react-native' {
154
156
 
155
157
  export type FocusGuideMethods = {
156
158
  setDestinations: (
157
- destinations: (React.ElementRef<HostComponent<unknown>> | null | undefined)[],
159
+ destinations: FocusDestination[],
158
160
  ) => void;
159
161
  }
160
162