react-native 0.82.0-rc.0 → 0.83.0-nightly-20250904-5d65794ee

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 (121) hide show
  1. package/Libraries/Core/ReactNativeVersion.js +2 -2
  2. package/Libraries/Core/setUpPerformance.js +3 -5
  3. package/Libraries/Lists/FlatList.js +8 -8
  4. package/Libraries/Lists/ViewabilityHelper.js +1 -1
  5. package/Libraries/Lists/VirtualizedList.js +1 -0
  6. package/Libraries/Network/XMLHttpRequest.js +0 -2
  7. package/Libraries/Text/TextInput/RCTBaseTextInputViewManager.mm +1 -1
  8. package/Libraries/TypeSafety/RCTTypedModuleConstants.mm +1 -1
  9. package/React/Base/RCTBridgeProxy.mm +6 -6
  10. package/React/Base/RCTVersion.m +2 -2
  11. package/React/Base/Surface/SurfaceHostingView/RCTSurfaceSizeMeasureMode.mm +4 -4
  12. package/React/CoreModules/RCTActionSheetManager.mm +10 -10
  13. package/React/CoreModules/RCTAlertController.mm +8 -3
  14. package/React/CoreModules/RCTAlertManager.mm +2 -2
  15. package/React/CoreModules/RCTDevMenu.mm +7 -7
  16. package/React/CoreModules/RCTEventDispatcher.mm +10 -8
  17. package/React/CoreModules/RCTExceptionsManager.mm +7 -7
  18. package/React/CoreModules/RCTFPSGraph.mm +3 -3
  19. package/React/CoreModules/RCTLogBox.mm +6 -6
  20. package/React/CoreModules/RCTLogBoxView.mm +1 -1
  21. package/React/CoreModules/RCTPerfMonitor.mm +19 -19
  22. package/React/CxxBridge/RCTMessageThread.mm +1 -1
  23. package/React/CxxBridge/RCTObjcExecutor.mm +2 -2
  24. package/React/CxxModule/RCTCxxMethod.mm +1 -1
  25. package/React/CxxModule/RCTNativeModule.mm +5 -5
  26. package/React/DevSupport/RCTInspectorDevServerHelper.mm +4 -4
  27. package/React/DevSupport/RCTInspectorNetworkHelper.mm +2 -2
  28. package/React/DevSupport/RCTPausedInDebuggerOverlayController.mm +1 -1
  29. package/React/FBReactNativeSpec/FBReactNativeSpecJSI-generated.cpp +6 -12
  30. package/React/FBReactNativeSpec/FBReactNativeSpecJSI.h +9 -18
  31. package/React/Fabric/Mounting/ComponentViews/Modal/RCTFabricModalHostViewController.mm +2 -2
  32. package/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.mm +6 -2
  33. package/ReactAndroid/gradle.properties +1 -1
  34. package/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java +12 -3
  35. package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/MountingManager.kt +0 -23
  36. package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.java +22 -0
  37. package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/PrefetchResourcesMountItem.kt +35 -0
  38. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt +7 -13
  39. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt +11 -21
  40. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt +3 -5
  41. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt +3 -5
  42. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt +12 -23
  43. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt +3 -5
  44. package/ReactAndroid/src/main/java/com/facebook/react/modules/core/JavaTimerManager.kt +7 -0
  45. package/ReactAndroid/src/main/java/com/facebook/react/modules/image/ImageLoaderModule.kt +2 -2
  46. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.kt +2 -2
  47. package/ReactAndroid/src/main/java/com/facebook/react/runtime/JSTimerExecutor.kt +9 -4
  48. package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.kt +76 -91
  49. package/ReactAndroid/src/main/java/com/facebook/react/runtime/{BridgelessReactStateTracker.kt → ReactHostStateTracker.kt} +6 -7
  50. package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactInstance.kt +1 -5
  51. package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactLifecycleStateManager.kt +9 -11
  52. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/BackgroundStyleApplicator.kt +53 -145
  53. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManager.java +3 -1
  54. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/drawable/CompositeBackgroundDrawable.kt +0 -32
  55. package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp +15 -29
  56. package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h +4 -7
  57. package/ReactAndroid/src/main/jni/react/runtime/jni/JJSTimerExecutor.cpp +6 -0
  58. package/ReactAndroid/src/main/jni/react/runtime/jni/JJSTimerExecutor.h +4 -2
  59. package/ReactAndroid/src/main/jni/react/runtime/jni/JReactInstance.cpp +0 -8
  60. package/ReactAndroid/src/main/jni/react/runtime/jni/JReactInstance.h +0 -6
  61. package/ReactCommon/cxxreact/ReactNativeVersion.h +3 -3
  62. package/ReactCommon/jsinspector-modern/React-jsinspector.podspec +2 -0
  63. package/ReactCommon/jsinspector-modern/ScopedExecutor.h +1 -1
  64. package/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.cpp +1 -1
  65. package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp +5 -9
  66. package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h +6 -11
  67. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp +44 -62
  68. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h +4 -6
  69. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h +5 -9
  70. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h +10 -19
  71. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h +2 -3
  72. package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp +6 -11
  73. package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h +3 -5
  74. package/ReactCommon/react/renderer/animated/NativeAnimatedNodesManager.cpp +3 -0
  75. package/ReactCommon/react/renderer/animated/nodes/AnimatedNode.cpp +2 -0
  76. package/ReactCommon/react/renderer/animated/nodes/AnimatedNode.h +1 -0
  77. package/ReactCommon/react/renderer/animated/nodes/ObjectAnimatedNode.cpp +121 -0
  78. package/ReactCommon/react/renderer/animated/nodes/ObjectAnimatedNode.h +38 -0
  79. package/ReactCommon/react/renderer/animated/nodes/PropsAnimatedNode.cpp +7 -0
  80. package/ReactCommon/react/renderer/animated/nodes/StyleAnimatedNode.cpp +7 -0
  81. package/ReactCommon/react/renderer/animated/tests/AnimatedNodeTests.cpp +51 -0
  82. package/ReactCommon/react/renderer/components/view/AccessibilityPrimitives.h +2 -60
  83. package/ReactCommon/react/renderer/components/view/accessibilityPropsConversions.h +56 -0
  84. package/ReactCommon/react/renderer/components/view/conversions.h +1 -1
  85. package/ReactCommon/react/renderer/components/view/platform/android/react/renderer/components/view/HostPlatformViewProps.cpp +3 -40
  86. package/ReactCommon/react/renderer/imagemanager/ImageResponseObserverCoordinator.cpp +3 -5
  87. package/ReactCommon/react/renderer/imagemanager/platform/android/react/renderer/imagemanager/ImageFetcher.cpp +20 -22
  88. package/ReactCommon/react/renderer/imagemanager/platform/android/react/renderer/imagemanager/ImageFetcher.h +3 -1
  89. package/ReactCommon/react/renderer/imagemanager/platform/android/react/renderer/imagemanager/ImageRequestParams.h +0 -1
  90. package/ReactCommon/react/renderer/imagemanager/platform/android/react/renderer/imagemanager/conversions.h +1 -3
  91. package/flow/bom.js.flow +157 -0
  92. package/index.js.flow +1 -0
  93. package/package.json +8 -11
  94. package/scripts/cocoapods/autolinking.rb +6 -0
  95. package/scripts/cocoapods/codegen_utils.rb +1 -1
  96. package/scripts/codegen/generate-artifacts-executor/index.js +5 -1
  97. package/scripts/codegen/generate-artifacts-executor/utils.js +41 -10
  98. package/scripts/replace-rncore-version.js +4 -2
  99. package/sdks/hermes-engine/utils/replace_hermes_version.js +4 -2
  100. package/sdks/hermesc/osx-bin/hermes +0 -0
  101. package/sdks/hermesc/osx-bin/hermesc +0 -0
  102. package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
  103. package/settings.gradle.kts +9 -0
  104. package/src/private/components/virtualview/VirtualView.js +22 -27
  105. package/src/private/featureflags/ReactNativeFeatureFlags.js +12 -11
  106. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +2 -3
  107. package/src/private/setup/{setUpPerformanceObserver.js → setUpPerformanceModern.js} +43 -18
  108. package/src/private/webapis/performance/EventTiming.js +34 -15
  109. package/src/private/webapis/performance/LongTasks.js +35 -2
  110. package/src/private/webapis/performance/Performance.js +23 -6
  111. package/src/private/webapis/performance/PerformanceEntry.js +21 -8
  112. package/src/private/webapis/performance/PerformanceObserver.js +30 -1
  113. package/src/private/webapis/performance/ResourceTiming.js +29 -18
  114. package/src/private/webapis/performance/UserTiming.js +33 -28
  115. package/src/private/webapis/performance/internals/RawPerformanceEntry.js +3 -4
  116. package/third-party-podspecs/replace_dependencies_version.js +4 -2
  117. package/types_generated/Libraries/Lists/VirtualizedList.d.ts +2 -2
  118. package/types_generated/index.d.ts +2 -2
  119. package/types_generated/src/private/components/virtualview/VirtualView.d.ts +7 -7
  120. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/drawable/CSSBackgroundDrawable.java +0 -1474
  121. package/sdks/.hermesversion +0 -1
@@ -27,9 +27,9 @@
27
27
  */
28
28
  export default class ReactNativeVersion {
29
29
  static major: number = 0;
30
- static minor: number = 82;
30
+ static minor: number = 83;
31
31
  static patch: number = 0;
32
- static prerelease: string | null = 'rc.0';
32
+ static prerelease: string | null = 'nightly-20250904-5d65794ee';
33
33
 
34
34
  static getVersionString(): string {
35
35
  return `${this.major}.${this.minor}.${this.patch}${this.prerelease != null ? `-${this.prerelease}` : ''}`;
@@ -4,19 +4,17 @@
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
7
+ * @flow strict-local
8
8
  * @format
9
9
  */
10
10
 
11
+ import setUpPerformanceModern from '../../src/private/setup/setUpPerformanceModern';
11
12
  import NativePerformance from '../../src/private/webapis/performance/specs/NativePerformance';
12
13
 
13
14
  // In case if the native implementation of the Performance API is available, use it,
14
15
  // otherwise fall back to the legacy/default one, which only defines 'Performance.now()'
15
16
  if (NativePerformance) {
16
- const Performance =
17
- require('../../src/private/webapis/performance/Performance').default;
18
- // $FlowExpectedError[cannot-write]
19
- global.performance = new Performance();
17
+ setUpPerformanceModern();
20
18
  } else {
21
19
  if (!global.performance) {
22
20
  // $FlowExpectedError[cannot-write]
@@ -13,8 +13,8 @@ import type {ViewStyleProp} from '../StyleSheet/StyleSheet';
13
13
  import type {
14
14
  ListRenderItem,
15
15
  ListRenderItemInfo,
16
+ ListViewToken,
16
17
  ViewabilityConfigCallbackPair,
17
- ViewToken,
18
18
  VirtualizedListProps,
19
19
  } from '@react-native/virtualized-lists';
20
20
 
@@ -573,7 +573,7 @@ class FlatList<ItemT = any> extends React.PureComponent<FlatListProps<ItemT>> {
573
573
  return keyExtractor(items, index);
574
574
  };
575
575
 
576
- _pushMultiColumnViewable(arr: Array<ViewToken>, v: ViewToken): void {
576
+ _pushMultiColumnViewable(arr: Array<ListViewToken>, v: ListViewToken): void {
577
577
  const numColumns = numColumnsOrDefault(this.props.numColumns);
578
578
  const keyExtractor = this.props.keyExtractor ?? defaultKeyExtractor;
579
579
  v.item.forEach((item, ii) => {
@@ -585,22 +585,22 @@ class FlatList<ItemT = any> extends React.PureComponent<FlatListProps<ItemT>> {
585
585
 
586
586
  _createOnViewableItemsChanged(
587
587
  onViewableItemsChanged: ?(info: {
588
- viewableItems: Array<ViewToken>,
589
- changed: Array<ViewToken>,
588
+ viewableItems: Array<ListViewToken>,
589
+ changed: Array<ListViewToken>,
590
590
  ...
591
591
  }) => void,
592
592
  // $FlowFixMe[missing-local-annot]
593
593
  ) {
594
594
  return (info: {
595
- viewableItems: Array<ViewToken>,
596
- changed: Array<ViewToken>,
595
+ viewableItems: Array<ListViewToken>,
596
+ changed: Array<ListViewToken>,
597
597
  ...
598
598
  }) => {
599
599
  const numColumns = numColumnsOrDefault(this.props.numColumns);
600
600
  if (onViewableItemsChanged) {
601
601
  if (numColumns > 1) {
602
- const changed: Array<ViewToken> = [];
603
- const viewableItems: Array<ViewToken> = [];
602
+ const changed: Array<ListViewToken> = [];
603
+ const viewableItems: Array<ListViewToken> = [];
604
604
  info.viewableItems.forEach(v =>
605
605
  this._pushMultiColumnViewable(viewableItems, v),
606
606
  );
@@ -11,7 +11,7 @@
11
11
  'use strict';
12
12
 
13
13
  export type {
14
- ViewToken,
14
+ ListViewToken as ViewToken,
15
15
  ViewabilityConfig,
16
16
  ViewabilityConfigCallbackPair,
17
17
  } from '@react-native/virtualized-lists';
@@ -19,6 +19,7 @@ const VirtualizedListComponent: VirtualizedListType =
19
19
  export type {
20
20
  ListRenderItemInfo,
21
21
  ListRenderItem,
22
+ ListViewToken,
22
23
  Separators,
23
24
  VirtualizedListProps,
24
25
  } from '@react-native/virtualized-lists';
@@ -649,8 +649,6 @@ class XMLHttpRequest extends EventTarget {
649
649
  this._url,
650
650
  this._headers,
651
651
  data,
652
- /* $FlowFixMe(>=0.78.0 site=react_native_android_fb) This issue was found
653
- * when making Flow check .android.js files. */
654
652
  nativeResponseType,
655
653
  incrementalEvents,
656
654
  this.timeout,
@@ -141,7 +141,7 @@ RCT_EXPORT_METHOD(setTextAndSelection
141
141
  RCTExecuteOnUIManagerQueue(^{
142
142
  RCTBaseTextInputShadowView *shadowView =
143
143
  (RCTBaseTextInputShadowView *)[self.bridge.uiManager shadowViewForReactTag:viewTag];
144
- if (value) {
144
+ if (value != nullptr) {
145
145
  [shadowView setText:value];
146
146
  }
147
147
  [self.bridge.uiManager setNeedsLayout];
@@ -16,7 +16,7 @@
16
16
  + (instancetype)newWithUnsafeDictionary:(NSDictionary<NSString *, id> *)dictionary
17
17
  {
18
18
  _RCTTypedModuleConstants *constants = [self new];
19
- if (constants) {
19
+ if (constants != nullptr) {
20
20
  constants->_dictionary = dictionary;
21
21
  }
22
22
  return constants;
@@ -53,7 +53,7 @@ using namespace facebook;
53
53
  launchOptions:(nullable NSDictionary *)launchOptions
54
54
  {
55
55
  self = [super self];
56
- if (self) {
56
+ if (self != nullptr) {
57
57
  _uiManagerProxy = [[RCTUIManagerProxy alloc] initWithViewRegistry:viewRegistry];
58
58
  _moduleRegistry = moduleRegistry;
59
59
  _bundleManager = bundleManager;
@@ -75,7 +75,7 @@ using namespace facebook;
75
75
 
76
76
  if (queue == RCTJSThread) {
77
77
  _dispatchToJSThread(block);
78
- } else if (queue) {
78
+ } else if (queue != nullptr) {
79
79
  dispatch_async(queue, block);
80
80
  }
81
81
  }
@@ -427,7 +427,7 @@ using namespace facebook;
427
427
  - (instancetype)initWithViewRegistry:(RCTViewRegistry *)viewRegistry
428
428
  {
429
429
  self = [super self];
430
- if (self) {
430
+ if (self != nullptr) {
431
431
  _viewRegistry = viewRegistry;
432
432
  _legacyViewRegistry = [NSMutableDictionary new];
433
433
  }
@@ -443,8 +443,8 @@ using namespace facebook;
443
443
  {
444
444
  [self logWarning:@"Please migrate to RCTViewRegistry: @synthesize viewRegistry_DEPRECATED = _viewRegistry_DEPRECATED."
445
445
  cmd:_cmd];
446
- UIView *view = [_viewRegistry viewForReactTag:reactTag] ? [_viewRegistry viewForReactTag:reactTag]
447
- : [_legacyViewRegistry objectForKey:reactTag];
446
+ UIView *view = ([_viewRegistry viewForReactTag:reactTag] != nullptr) ? [_viewRegistry viewForReactTag:reactTag]
447
+ : [_legacyViewRegistry objectForKey:reactTag];
448
448
  return RCTPaperViewOrCurrentView(view);
449
449
  }
450
450
 
@@ -457,7 +457,7 @@ using namespace facebook;
457
457
  __weak __typeof(self) weakSelf = self;
458
458
  RCTExecuteOnMainQueue(^{
459
459
  __typeof(self) strongSelf = weakSelf;
460
- if (strongSelf) {
460
+ if (strongSelf != nullptr) {
461
461
  RCTUIManager *proxiedManager = (RCTUIManager *)strongSelf;
462
462
  RCTComposedViewRegistry *composedViewRegistry =
463
463
  [[RCTComposedViewRegistry alloc] initWithUIManager:proxiedManager
@@ -22,9 +22,9 @@ NSDictionary* RCTGetReactNativeVersion(void)
22
22
  dispatch_once(&onceToken, ^(void){
23
23
  __rnVersion = @{
24
24
  RCTVersionMajor: @(0),
25
- RCTVersionMinor: @(82),
25
+ RCTVersionMinor: @(83),
26
26
  RCTVersionPatch: @(0),
27
- RCTVersionPrerelease: @"rc.0",
27
+ RCTVersionPrerelease: @"nightly-20250904-5d65794ee",
28
28
  };
29
29
  });
30
30
  return __rnVersion;
@@ -18,17 +18,17 @@ void RCTSurfaceMinimumSizeAndMaximumSizeFromSizeAndSizeMeasureMode(
18
18
  *minimumSize = CGSizeZero;
19
19
  *maximumSize = CGSizeMake(CGFLOAT_MAX, CGFLOAT_MAX);
20
20
 
21
- if (sizeMeasureMode & RCTSurfaceSizeMeasureModeWidthExact) {
21
+ if ((sizeMeasureMode & RCTSurfaceSizeMeasureModeWidthExact) != 0) {
22
22
  minimumSize->width = size.width;
23
23
  maximumSize->width = size.width;
24
- } else if (sizeMeasureMode & RCTSurfaceSizeMeasureModeWidthAtMost) {
24
+ } else if ((sizeMeasureMode & RCTSurfaceSizeMeasureModeWidthAtMost) != 0) {
25
25
  maximumSize->width = size.width;
26
26
  }
27
27
 
28
- if (sizeMeasureMode & RCTSurfaceSizeMeasureModeHeightExact) {
28
+ if ((sizeMeasureMode & RCTSurfaceSizeMeasureModeHeightExact) != 0) {
29
29
  minimumSize->height = size.height;
30
30
  maximumSize->height = size.height;
31
- } else if (sizeMeasureMode & RCTSurfaceSizeMeasureModeHeightAtMost) {
31
+ } else if ((sizeMeasureMode & RCTSurfaceSizeMeasureModeHeightAtMost) != 0) {
32
32
  maximumSize->height = size.height;
33
33
  }
34
34
  }
@@ -31,7 +31,7 @@ using namespace facebook::react;
31
31
  - (instancetype)init
32
32
  {
33
33
  self = [super init];
34
- if (self) {
34
+ if (self != nullptr) {
35
35
  _alertControllers = [NSMutableArray new];
36
36
  }
37
37
  return self;
@@ -53,7 +53,7 @@ RCT_EXPORT_MODULE()
53
53
  alertController.modalPresentationStyle = UIModalPresentationPopover;
54
54
  UIView *sourceView = parentViewController.view;
55
55
 
56
- if (anchorViewTag) {
56
+ if (anchorViewTag != nullptr) {
57
57
  sourceView = [self.viewRegistry_DEPRECATED viewForReactTag:anchorViewTag];
58
58
  } else {
59
59
  alertController.popoverPresentationController.permittedArrowDirections = 0;
@@ -166,12 +166,12 @@ RCT_EXPORT_METHOD(showActionSheetWithOptions
166
166
  index++;
167
167
  }
168
168
 
169
- if (disabledButtonIndices) {
169
+ if (disabledButtonIndices != nullptr) {
170
170
  for (NSNumber *disabledButtonIndex in disabledButtonIndices) {
171
171
  if ([disabledButtonIndex integerValue] < buttons.count) {
172
172
  UIAlertAction *action = alertController.actions[[disabledButtonIndex integerValue]];
173
173
  [action setEnabled:false];
174
- if (disabledButtonTintColor) {
174
+ if (disabledButtonTintColor != nullptr) {
175
175
  [action setValue:disabledButtonTintColor forKey:@"titleTextColor"];
176
176
  }
177
177
  } else {
@@ -235,14 +235,14 @@ RCT_EXPORT_METHOD(showShareActionSheetWithOptions
235
235
  UIColor *tintColor = [RCTConvert UIColor:options.tintColor() ? @(*options.tintColor()) : nil];
236
236
 
237
237
  dispatch_async(dispatch_get_main_queue(), ^{
238
- if (message) {
238
+ if (message != nullptr) {
239
239
  [items addObject:message];
240
240
  }
241
- if (URL) {
241
+ if (URL != nullptr) {
242
242
  if ([URL.scheme.lowercaseString isEqualToString:@"data"]) {
243
243
  NSError *error;
244
244
  NSData *data = [NSData dataWithContentsOfURL:URL options:(NSDataReadingOptions)0 error:&error];
245
- if (!data) {
245
+ if (data == nullptr) {
246
246
  failureCallback(@[ RCTJSErrorFromNSError(error) ]);
247
247
  return;
248
248
  }
@@ -258,17 +258,17 @@ RCT_EXPORT_METHOD(showShareActionSheetWithOptions
258
258
 
259
259
  UIActivityViewController *shareController = [[UIActivityViewController alloc] initWithActivityItems:items
260
260
  applicationActivities:nil];
261
- if (subject) {
261
+ if (subject != nullptr) {
262
262
  [shareController setValue:subject forKey:@"subject"];
263
263
  }
264
- if (excludedActivityTypes) {
264
+ if (excludedActivityTypes != nullptr) {
265
265
  shareController.excludedActivityTypes = excludedActivityTypes;
266
266
  }
267
267
 
268
268
  UIViewController *controller = RCTPresentedViewController();
269
269
  shareController.completionWithItemsHandler =
270
270
  ^(NSString *activityType, BOOL completed, __unused NSArray *returnedItems, NSError *activityError) {
271
- if (activityError) {
271
+ if (activityError != nullptr) {
272
272
  failureCallback(@[ RCTJSErrorFromNSError(activityError) ]);
273
273
  } else if (completed || activityType == nil) {
274
274
  successCallback(@[ @(completed), RCTNullIfNil(activityType) ]);
@@ -20,9 +20,14 @@
20
20
  - (UIWindow *)alertWindow
21
21
  {
22
22
  if (_alertWindow == nil) {
23
- _alertWindow = [[UIWindow alloc] initWithWindowScene:RCTKeyWindow().windowScene];
23
+ UIWindowScene *scene = RCTKeyWindow().windowScene;
24
+ if (scene != nil) {
25
+ _alertWindow = [[UIWindow alloc] initWithWindowScene:scene];
26
+ } else {
27
+ _alertWindow = [[UIWindow alloc] initWithFrame:UIScreen.mainScreen.bounds];
28
+ }
24
29
 
25
- if (_alertWindow) {
30
+ if (_alertWindow != nullptr) {
26
31
  _alertWindow.rootViewController = [UIViewController new];
27
32
  _alertWindow.windowLevel = UIWindowLevelAlert + 1;
28
33
  }
@@ -36,7 +41,7 @@
36
41
  UIUserInterfaceStyle style = self.overrideUserInterfaceStyle;
37
42
  if (style == UIUserInterfaceStyleUnspecified) {
38
43
  UIUserInterfaceStyle overriddenStyle = RCTKeyWindow().overrideUserInterfaceStyle;
39
- style = overriddenStyle ? overriddenStyle : UIUserInterfaceStyleUnspecified;
44
+ style = (overriddenStyle != 0) ? overriddenStyle : UIUserInterfaceStyleUnspecified;
40
45
  }
41
46
 
42
47
  self.overrideUserInterfaceStyle = style;
@@ -86,7 +86,7 @@ RCT_EXPORT_METHOD(alertWithArgs : (JS::NativeAlertManager::Args &)args callback
86
86
  UIKeyboardType keyboardType = [RCTConvert UIKeyboardType:args.keyboardType()];
87
87
  UIUserInterfaceStyle userInterfaceStyle = [RCTConvert UIUserInterfaceStyle:args.userInterfaceStyle()];
88
88
 
89
- if (!title && !message) {
89
+ if ((title == nullptr) && (message == nullptr)) {
90
90
  RCTLogError(@"Must specify either an alert title, or message, or both");
91
91
  return;
92
92
  }
@@ -193,7 +193,7 @@ RCT_EXPORT_METHOD(alertWithArgs : (JS::NativeAlertManager::Args &)args callback
193
193
  }
194
194
  }
195
195
 
196
- if (!self->_alertControllers) {
196
+ if (self->_alertControllers == nullptr) {
197
197
  self->_alertControllers = [NSHashTable weakObjectsHashTable];
198
198
  }
199
199
  [self->_alertControllers addObject:alertController];
@@ -47,7 +47,7 @@ NSString *const RCTShowDevMenuNotification = @"RCTShowDevMenuNotification";
47
47
 
48
48
  - (instancetype)initWithTitleBlock:(RCTDevMenuItemTitleBlock)titleBlock handler:(dispatch_block_t)handler
49
49
  {
50
- if ((self = [super init])) {
50
+ if ((self = [super init]) != nullptr) {
51
51
  _titleBlock = [titleBlock copy];
52
52
  _handler = [handler copy];
53
53
  }
@@ -72,14 +72,14 @@ RCT_NOT_IMPLEMENTED(-(instancetype)init)
72
72
 
73
73
  - (void)callHandler
74
74
  {
75
- if (_handler) {
75
+ if (_handler != nullptr) {
76
76
  _handler();
77
77
  }
78
78
  }
79
79
 
80
80
  - (NSString *)title
81
81
  {
82
- if (_titleBlock) {
82
+ if (_titleBlock != nullptr) {
83
83
  return _titleBlock();
84
84
  }
85
85
  return nil;
@@ -120,7 +120,7 @@ RCT_EXPORT_MODULE()
120
120
 
121
121
  - (instancetype)init
122
122
  {
123
- if ((self = [super init])) {
123
+ if ((self = [super init]) != nullptr) {
124
124
  [[NSNotificationCenter defaultCenter] addObserver:self
125
125
  selector:@selector(showOnShake)
126
126
  name:RCTShowDevMenuNotification
@@ -214,7 +214,7 @@ RCT_EXPORT_MODULE()
214
214
  if (_actionSheet.isBeingPresented || _actionSheet.beingDismissed) {
215
215
  return;
216
216
  }
217
- if (_actionSheet) {
217
+ if (_actionSheet != nullptr) {
218
218
  [_actionSheet dismissViewControllerAnimated:YES
219
219
  completion:^(void) {
220
220
  self->_actionSheet = nil;
@@ -379,7 +379,7 @@ RCT_EXPORT_MODULE()
379
379
 
380
380
  RCT_EXPORT_METHOD(show)
381
381
  {
382
- if (_actionSheet || RCTRunningInAppExtension()) {
382
+ if ((_actionSheet != nullptr) || RCTRunningInAppExtension()) {
383
383
  return;
384
384
  }
385
385
 
@@ -412,7 +412,7 @@ RCT_EXPORT_METHOD(show)
412
412
  - (RCTDevMenuAlertActionHandler)alertActionHandlerForDevItem:(RCTDevMenuItem *__nullable)item
413
413
  {
414
414
  return ^(__unused UIAlertAction *action) {
415
- if (item) {
415
+ if (item != nullptr) {
416
416
  [item callHandler];
417
417
  }
418
418
 
@@ -71,12 +71,14 @@ RCT_EXPORT_MODULE()
71
71
  {
72
72
  [_callableJSModules invokeModule:@"RCTNativeAppEventEmitter"
73
73
  method:@"emit"
74
- withArgs:body ? @[ name, body ] : @[ name ]];
74
+ withArgs:(body != nullptr) ? @[ name, body ] : @[ name ]];
75
75
  }
76
76
 
77
77
  - (void)sendDeviceEventWithName:(NSString *)name body:(id)body
78
78
  {
79
- [_callableJSModules invokeModule:@"RCTDeviceEventEmitter" method:@"emit" withArgs:body ? @[ name, body ] : @[ name ]];
79
+ [_callableJSModules invokeModule:@"RCTDeviceEventEmitter"
80
+ method:@"emit"
81
+ withArgs:(body != nullptr) ? @[ name, body ] : @[ name ]];
80
82
  }
81
83
 
82
84
  - (void)sendTextEventWithType:(RCTTextEventType)type
@@ -91,13 +93,13 @@ RCT_EXPORT_MODULE()
91
93
  @"eventCount" : @(eventCount),
92
94
  }];
93
95
 
94
- if (text) {
96
+ if (text != nullptr) {
95
97
  // We copy the string here because if it's a mutable string it may get released before we dispatch the event on a
96
98
  // different thread, causing a crash.
97
99
  body[@"text"] = [text copy];
98
100
  }
99
101
 
100
- if (key) {
102
+ if (key != nullptr) {
101
103
  if (key.length == 0) {
102
104
  key = @"Backspace"; // backspace
103
105
  } else {
@@ -142,7 +144,7 @@ RCT_EXPORT_MODULE()
142
144
  if (event.canCoalesce) {
143
145
  eventID = RCTGetEventID(event.viewTag, event.eventName, event.coalescingKey);
144
146
  id<RCTEvent> previousEvent = _events[eventID];
145
- if (previousEvent) {
147
+ if (previousEvent != nullptr) {
146
148
  event = [previousEvent coalesceWithEvent:event];
147
149
  } else {
148
150
  [_eventQueue addObject:eventID];
@@ -173,13 +175,13 @@ RCT_EXPORT_MODULE()
173
175
  [_eventQueueLock unlock];
174
176
 
175
177
  if (scheduleEventsDispatch) {
176
- if (_bridge) {
178
+ if (_bridge != nullptr) {
177
179
  [_bridge
178
180
  dispatchBlock:^{
179
181
  [self flushEventsQueue];
180
182
  }
181
183
  queue:RCTJSThread];
182
- } else if (_dispatchToJSThread) {
184
+ } else if (_dispatchToJSThread != nullptr) {
183
185
  _dispatchToJSThread(^{
184
186
  [self flushEventsQueue];
185
187
  });
@@ -236,7 +238,7 @@ RCT_EXPORT_MODULE()
236
238
  {
237
239
  NSDictionary *userInfo = notification.userInfo;
238
240
  id<RCTEvent> event = [userInfo objectForKey:@"event"];
239
- if (event) {
241
+ if (event != nullptr) {
240
242
  [self notifyObserversOfEvent:event];
241
243
  }
242
244
  }
@@ -30,7 +30,7 @@ RCT_EXPORT_MODULE()
30
30
 
31
31
  - (instancetype)initWithDelegate:(id<RCTExceptionsManagerDelegate>)delegate
32
32
  {
33
- if ((self = [self init])) {
33
+ if ((self = [self init]) != nullptr) {
34
34
  _delegate = delegate;
35
35
  }
36
36
  return self;
@@ -46,7 +46,7 @@ RCT_EXPORT_MODULE()
46
46
  [redbox showErrorMessage:message withStack:stack errorCookie:(int)exceptionId];
47
47
  }
48
48
 
49
- if (_delegate) {
49
+ if (_delegate != nullptr) {
50
50
  [_delegate handleSoftJSExceptionWithMessage:message
51
51
  stack:stack
52
52
  exceptionId:[NSNumber numberWithDouble:exceptionId]
@@ -64,7 +64,7 @@ RCT_EXPORT_MODULE()
64
64
  [redbox showErrorMessage:message withStack:stack errorCookie:(int)exceptionId];
65
65
  }
66
66
 
67
- if (_delegate) {
67
+ if (_delegate != nullptr) {
68
68
  [_delegate handleFatalJSExceptionWithMessage:message
69
69
  stack:stack
70
70
  exceptionId:[NSNumber numberWithDouble:exceptionId]
@@ -107,13 +107,13 @@ RCT_EXPORT_METHOD(reportException : (JS::NativeExceptionsManager::ExceptionData
107
107
  {
108
108
  NSMutableDictionary<NSString *, id> *mutableErrorData = [NSMutableDictionary new];
109
109
  mutableErrorData[@"message"] = data.message();
110
- if (data.originalMessage()) {
110
+ if (data.originalMessage() != nullptr) {
111
111
  mutableErrorData[@"originalMessage"] = data.originalMessage();
112
112
  }
113
- if (data.name()) {
113
+ if (data.name() != nullptr) {
114
114
  mutableErrorData[@"name"] = data.name();
115
115
  }
116
- if (data.componentStack()) {
116
+ if (data.componentStack() != nullptr) {
117
117
  mutableErrorData[@"componentStack"] = data.componentStack();
118
118
  }
119
119
 
@@ -141,7 +141,7 @@ RCT_EXPORT_METHOD(reportException : (JS::NativeExceptionsManager::ExceptionData
141
141
  mutableErrorData[@"id"] = @(data.id_());
142
142
  mutableErrorData[@"isFatal"] = @(data.isFatal());
143
143
 
144
- if (data.extraData()) {
144
+ if (data.extraData() != nullptr) {
145
145
  mutableErrorData[@"extraData"] = data.extraData();
146
146
  }
147
147
 
@@ -37,7 +37,7 @@
37
37
 
38
38
  - (instancetype)initWithFrame:(CGRect)frame color:(UIColor *)color
39
39
  {
40
- if ((self = [super initWithFrame:frame])) {
40
+ if ((self = [super initWithFrame:frame]) != nullptr) {
41
41
  _frameCount = -1;
42
42
  _prevTime = -1;
43
43
  _maxFPS = 0;
@@ -64,7 +64,7 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : (NSCoder *)aDecoder)
64
64
 
65
65
  - (CAShapeLayer *)graph
66
66
  {
67
- if (!_graph) {
67
+ if (_graph == nullptr) {
68
68
  _graph = [CAShapeLayer new];
69
69
  _graph.frame = self.bounds;
70
70
  _graph.backgroundColor = [_color colorWithAlphaComponent:0.2].CGColor;
@@ -76,7 +76,7 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : (NSCoder *)aDecoder)
76
76
 
77
77
  - (UILabel *)label
78
78
  {
79
- if (!_label) {
79
+ if (_label == nullptr) {
80
80
  _label = [[UILabel alloc] initWithFrame:self.bounds];
81
81
  _label.font = [UIFont boldSystemFontOfSize:13];
82
82
  _label.textAlignment = NSTextAlignmentCenter;
@@ -45,23 +45,23 @@ RCT_EXPORT_METHOD(show)
45
45
  __weak RCTLogBox *weakSelf = self;
46
46
  dispatch_async(dispatch_get_main_queue(), ^{
47
47
  __strong RCTLogBox *strongSelf = weakSelf;
48
- if (!strongSelf) {
48
+ if (strongSelf == nullptr) {
49
49
  return;
50
50
  }
51
51
 
52
- if (strongSelf->_view) {
52
+ if (strongSelf->_view != nullptr) {
53
53
  [strongSelf->_view show];
54
54
  return;
55
55
  }
56
56
 
57
- if (strongSelf->_bridgelessSurfacePresenter) {
57
+ if (strongSelf->_bridgelessSurfacePresenter != nullptr) {
58
58
  strongSelf->_view = [[RCTLogBoxView alloc] initWithWindow:RCTKeyWindow()
59
59
  surfacePresenter:strongSelf->_bridgelessSurfacePresenter];
60
60
  [strongSelf->_view show];
61
61
  }
62
62
  #ifndef RCT_FIT_RM_OLD_RUNTIME
63
- else if (strongSelf->_bridge && strongSelf->_bridge.valid) {
64
- if (strongSelf->_bridge.surfacePresenter) {
63
+ else if ((strongSelf->_bridge != nullptr) && strongSelf->_bridge.valid) {
64
+ if (strongSelf->_bridge.surfacePresenter != nullptr) {
65
65
  strongSelf->_view = [[RCTLogBoxView alloc] initWithWindow:RCTKeyWindow()
66
66
  surfacePresenter:strongSelf->_bridge.surfacePresenter];
67
67
  } else {
@@ -80,7 +80,7 @@ RCT_EXPORT_METHOD(hide)
80
80
  __weak RCTLogBox *weakSelf = self;
81
81
  dispatch_async(dispatch_get_main_queue(), ^{
82
82
  __strong RCTLogBox *strongSelf = weakSelf;
83
- if (!strongSelf) {
83
+ if (strongSelf == nullptr) {
84
84
  return;
85
85
  }
86
86
  [strongSelf->_view setHidden:YES];
@@ -19,7 +19,7 @@
19
19
 
20
20
  - (instancetype)initWithFrame:(CGRect)frame
21
21
  {
22
- if ((self = [super initWithFrame:frame])) {
22
+ if ((self = [super initWithFrame:frame]) != nullptr) {
23
23
  self.windowLevel = UIWindowLevelStatusBar - 1;
24
24
  self.backgroundColor = [UIColor clearColor];
25
25
  }