react-native-screens 4.19.0-nightly-20251030-193c63f33 → 4.19.0-nightly-20251101-690f01275

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.
@@ -53,6 +53,8 @@ void NativeProxy::nativeAddMutationsListener(
53
53
  }
54
54
 
55
55
  void NativeProxy::cleanupExpiredMountingCoordinators() {
56
+ std::lock_guard<std::mutex> lock(coordinatorsMutex_);
57
+
56
58
  coordinatorsWithMountingOverrides_.erase(
57
59
  std::remove_if(
58
60
  coordinatorsWithMountingOverrides_.begin(),
@@ -65,6 +67,8 @@ void NativeProxy::cleanupExpiredMountingCoordinators() {
65
67
  void NativeProxy::addMountingCoordinatorIfNeeded(
66
68
  const std::shared_ptr<const facebook::react::MountingCoordinator>
67
69
  &coordinator) {
70
+ std::lock_guard<std::mutex> lock(coordinatorsMutex_);
71
+
68
72
  bool wasRegistered = std::ranges::any_of(
69
73
  coordinatorsWithMountingOverrides_,
70
74
  [&coordinator](
@@ -4,6 +4,7 @@
4
4
  #include <react/fabric/JFabricUIManager.h>
5
5
  #include "RNSScreenRemovalListener.h"
6
6
 
7
+ #include <mutex>
7
8
  #include <string>
8
9
 
9
10
  namespace rnscreens {
@@ -25,6 +26,8 @@ class NativeProxy : public jni::HybridClass<NativeProxy> {
25
26
  friend HybridBase;
26
27
  jni::global_ref<NativeProxy::javaobject> javaPart_;
27
28
 
29
+ std::mutex coordinatorsMutex_;
30
+
28
31
  explicit NativeProxy(jni::alias_ref<NativeProxy::javaobject> jThis);
29
32
 
30
33
  void nativeAddMutationsListener(
package/ios/RNSScreen.h CHANGED
@@ -171,13 +171,21 @@ namespace react = facebook::react;
171
171
  - (BOOL)isModal;
172
172
  - (BOOL)isPresentedAsNativeModal;
173
173
 
174
+ /**
175
+ * Tell `Screen` component that it has been removed from react state and can safely cleanup
176
+ * any retained resources.
177
+ */
178
+ - (void)invalidateImpl;
179
+
180
+ #ifndef RCT_NEW_ARCH_ENABLED
174
181
  /**
175
182
  * Tell `Screen` component that it has been removed from react state and can safely cleanup
176
183
  * any retained resources.
177
184
  *
178
- * Note, that on old architecture this method might be called by RN via `RCTInvalidating` protocol.
185
+ * On old architecture this method might be called by RN via `RCTInvalidating` protocol.
179
186
  */
180
187
  - (void)invalidate;
188
+ #endif // !RCT_NEW_ARCH_ENABLED
181
189
 
182
190
  /**
183
191
  * Looks for header configuration in instance's `reactSubviews` and returns it. If not present returns `nil`.
package/ios/RNSScreen.mm CHANGED
@@ -934,12 +934,19 @@ RNS_IGNORE_SUPER_CALL_END
934
934
  self.controller.modalPresentationStyle == UIModalPresentationOverCurrentContext;
935
935
  }
936
936
 
937
- - (void)invalidate
937
+ - (void)invalidateImpl
938
938
  {
939
939
  _controller = nil;
940
940
  [_sheetsScrollView removeObserver:self forKeyPath:@"bounds" context:nil];
941
941
  }
942
942
 
943
+ #ifndef RCT_NEW_ARCH_ENABLED
944
+ - (void)invalidate
945
+ {
946
+ [self invalidateImpl];
947
+ }
948
+ #endif
949
+
943
950
  #if !TARGET_OS_TV && !TARGET_OS_VISION
944
951
 
945
952
  - (void)setPropertyForSheet:(UISheetPresentationController *)sheet withBlock:(void (^)(void))block animate:(BOOL)animate
@@ -266,7 +266,7 @@ RNS_IGNORE_SUPER_CALL_END
266
266
  [super load];
267
267
  }
268
268
 
269
- #pragma mark - RCTViewComponentViewProtocol
269
+ #pragma mark - RCTComponentViewProtocol
270
270
 
271
271
  - (void)mountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
272
272
  {
@@ -1409,7 +1409,11 @@ RNS_IGNORE_SUPER_CALL_END
1409
1409
  return;
1410
1410
  }
1411
1411
  for (RNSScreenView *screenRef : strongSelf->_toBeDeletedScreens) {
1412
+ #ifdef RCT_NEW_ARCH_ENABLED
1413
+ [screenRef invalidateImpl];
1414
+ #else
1412
1415
  [screenRef invalidate];
1416
+ #endif
1413
1417
  }
1414
1418
  strongSelf->_toBeDeletedScreens.clear();
1415
1419
  });
@@ -207,7 +207,7 @@ namespace react = facebook::react;
207
207
  return [_reactEventEmitter emitOnNativeFocusChange:OnNativeFocusChangePayload{.tabKey = tabScreen.tabKey}];
208
208
  }
209
209
 
210
- #pragma mark - RCTViewComponentViewProtocol
210
+ #pragma mark - RCTComponentViewProtocol
211
211
  #if RCT_NEW_ARCH_ENABLED
212
212
 
213
213
  - (void)mountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
@@ -243,7 +243,7 @@ RNS_IGNORE_SUPER_CALL_END
243
243
  }
244
244
 
245
245
  #if RCT_NEW_ARCH_ENABLED
246
- #pragma mark - RCTViewComponentViewProtocol
246
+ #pragma mark - RCTComponentViewProtocol
247
247
 
248
248
  - (void)updateProps:(const facebook::react::Props::Shared &)props
249
249
  oldProps:(const facebook::react::Props::Shared &)oldProps
@@ -116,13 +116,6 @@ static const CGFloat epsilon = 1e-6;
116
116
  }
117
117
  }
118
118
 
119
- - (void)willMoveToWindow:(UIWindow *)newWindow
120
- {
121
- if (newWindow == nil) {
122
- [self invalidate];
123
- }
124
- }
125
-
126
119
  - (void)didMoveToWindow
127
120
  {
128
121
  [self setupController];
@@ -148,17 +141,6 @@ static const CGFloat epsilon = 1e-6;
148
141
  }
149
142
  }
150
143
 
151
- - (void)invalidate
152
- {
153
- // We assume that split host is removed from view hierarchy **only** when
154
- // whole component is destroyed & therefore we do the necessary cleanup here.
155
- // If at some point that statement does not hold anymore, this cleanup
156
- // should be moved to a different place.
157
- for (RNSSplitViewScreenComponentView *subview in _reactSubviews) {
158
- [subview invalidate];
159
- }
160
- }
161
-
162
144
  RNS_IGNORE_SUPER_CALL_BEGIN
163
145
  - (nonnull NSMutableArray<RNSSplitViewScreenComponentView *> *)reactSubviews
164
146
  {
@@ -176,7 +158,7 @@ RNS_IGNORE_SUPER_CALL_END
176
158
  return _controller;
177
159
  }
178
160
 
179
- #pragma mark - RCTViewComponentViewProtocol
161
+ #pragma mark - RCTComponentViewProtocol
180
162
 
181
163
  - (void)mountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
182
164
  {
@@ -21,13 +21,6 @@ NS_ASSUME_NONNULL_BEGIN
21
21
  @property (nonatomic, strong, readonly, nonnull) RNSSplitViewScreenController *controller;
22
22
  @property (nonatomic, weak, readwrite, nullable) RNSSplitViewHostComponentView *splitViewHost;
23
23
 
24
- /**
25
- * @brief A function responsible for requesting a cleanup in the SplitViewScreen component.
26
- *
27
- * Should be called when the component is about to be deleted.
28
- */
29
- - (void)invalidate;
30
-
31
24
  @end
32
25
 
33
26
  #pragma mark - ShadowTreeState
@@ -85,14 +85,6 @@ namespace react = facebook::react;
85
85
  _columnType = RNSSplitViewScreenColumnTypeColumn;
86
86
  }
87
87
 
88
- - (void)invalidate
89
- {
90
- // Controller keeps the strong reference to the component via the `.view` property.
91
- // Therefore, we need to enforce a proper cleanup, breaking the retain cycle,
92
- // when we want to destroy the component.
93
- _controller = nil;
94
- }
95
-
96
88
  - (void)registerForFrameCorrection:(UIView *)view
97
89
  {
98
90
  [_viewsForFrameCorrection addObject:view];
@@ -155,7 +147,7 @@ namespace react = facebook::react;
155
147
  [self dispatchSafeAreaDidChangeNotification];
156
148
  }
157
149
 
158
- #pragma mark - RCTViewComponentViewProtocol
150
+ #pragma mark - RCTComponentViewProtocol
159
151
 
160
152
  + (react::ComponentDescriptorProvider)componentDescriptorProvider
161
153
  {
@@ -196,6 +188,14 @@ namespace react = facebook::react;
196
188
  updateEventEmitter:std::static_pointer_cast<const react::RNSSplitViewScreenEventEmitter>(eventEmitter)];
197
189
  }
198
190
 
191
+ - (void)invalidate
192
+ {
193
+ // Controller keeps the strong reference to the component via the `.view` property.
194
+ // Therefore, we need to enforce a proper cleanup, breaking the retain cycle,
195
+ // when we want to destroy the component.
196
+ _controller = nil;
197
+ }
198
+
199
199
  @end
200
200
 
201
201
  Class<RCTComponentViewProtocol> RNSSplitViewScreenCls(void)
@@ -75,7 +75,7 @@ RNS_IGNORE_SUPER_CALL_END
75
75
  return _controller;
76
76
  }
77
77
 
78
- #pragma mark - RCTViewComponentViewProtocol
78
+ #pragma mark - RCTComponentViewProtocol
79
79
 
80
80
  - (void)mountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
81
81
  {
@@ -66,7 +66,7 @@ namespace react = facebook::react;
66
66
  return _reactEventEmitter;
67
67
  }
68
68
 
69
- #pragma mark - RCTViewComponentViewProtocol
69
+ #pragma mark - RCTComponentViewProtocol
70
70
 
71
71
  - (void)updateProps:(const facebook::react::Props::Shared &)props
72
72
  oldProps:(const facebook::react::Props::Shared &)oldProps
@@ -166,7 +166,7 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithFrame : (CGRect)frame)
166
166
  #endif // RCT_NEW_ARCH_ENABLED
167
167
 
168
168
  #if RCT_NEW_ARCH_ENABLED
169
- #pragma mark - RCTViewComponentViewProtocol
169
+ #pragma mark - RCTComponentViewProtocol
170
170
 
171
171
  + (react::ComponentDescriptorProvider)componentDescriptorProvider
172
172
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-screens",
3
- "version": "4.19.0-nightly-20251030-193c63f33",
3
+ "version": "4.19.0-nightly-20251101-690f01275",
4
4
  "description": "Native navigation primitives for your React Native app.",
5
5
  "scripts": {
6
6
  "submodules": "git submodule update --init --recursive && (cd react-navigation && yarn && yarn build && cd ../)",
@@ -86,10 +86,10 @@
86
86
  "@react-native-community/cli": "20.0.0-alpha.2",
87
87
  "@react-native-community/cli-platform-android": "20.0.0-alpha.2",
88
88
  "@react-native-community/cli-platform-ios": "20.0.0-alpha.2",
89
- "@react-native/babel-preset": "0.82.0-rc.4",
90
- "@react-native/eslint-config": "0.82.0-rc.4",
91
- "@react-native/metro-config": "0.82.0-rc.4",
92
- "@react-native/typescript-config": "0.82.0-rc.4",
89
+ "@react-native/babel-preset": "0.82.1",
90
+ "@react-native/eslint-config": "0.82.1",
91
+ "@react-native/metro-config": "0.82.1",
92
+ "@react-native/typescript-config": "0.82.1",
93
93
  "@react-navigation/native": "^5.8.0",
94
94
  "@react-navigation/stack": "^5.10.0",
95
95
  "@types/jest": "^29.5.13",
@@ -112,7 +112,7 @@
112
112
  "prettier": "^2.8.8",
113
113
  "react": "^19.1.1",
114
114
  "react-dom": "^19.1.0",
115
- "react-native": "0.82.0-rc.4",
115
+ "react-native": "0.82.1",
116
116
  "react-native-builder-bob": "^0.23.2",
117
117
  "react-native-gesture-handler": "^2.28.0",
118
118
  "react-native-reanimated": "^3.19.0",