react-native-screens 4.17.0 → 4.17.1

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.
@@ -52,11 +52,11 @@ class RNSScreenStackHeaderConfigComponentDescriptor final
52
52
  #endif // ANDROID
53
53
 
54
54
  ConcreteComponentDescriptor::adopt(shadowNode);
55
- #if !defined(ANDROID) && !defined(NDEBUG)
55
+ #if !defined(ANDROID)
56
56
  std::weak_ptr<void> imageLoader =
57
57
  contextContainer_->at<std::shared_ptr<void>>("RCTImageLoader");
58
58
  configShadowNode.setImageLoader(imageLoader);
59
- #endif // !ANDROID && !NDEBUG
59
+ #endif // !ANDROID
60
60
  }
61
61
  };
62
62
 
@@ -18,7 +18,7 @@ void RNSScreenStackHeaderConfigShadowNode::layout(LayoutContext layoutContext) {
18
18
  // the toolbar & the correction is not needed.
19
19
  return;
20
20
  }
21
- #endif // ANDROID
21
+ #endif // defined(ANDROID)
22
22
  applyFrameCorrections();
23
23
  }
24
24
 
@@ -29,7 +29,7 @@ void RNSScreenStackHeaderConfigShadowNode::applyFrameCorrections() {
29
29
  layoutMetrics_.frame.origin.y = -stateData.frameSize.height;
30
30
  }
31
31
 
32
- #if !defined(ANDROID) && !defined(NDEBUG)
32
+ #if !defined(ANDROID)
33
33
  void RNSScreenStackHeaderConfigShadowNode::setImageLoader(
34
34
  std::weak_ptr<void> imageLoader) {
35
35
  getStateDataMutable().setImageLoader(imageLoader);
@@ -42,5 +42,5 @@ RNSScreenStackHeaderConfigShadowNode::getStateDataMutable() {
42
42
  return const_cast<RNSScreenStackHeaderConfigShadowNode::StateData &>(
43
43
  getStateData());
44
44
  }
45
- #endif // !ANDROID && !NDEBUG
45
+ #endif // !defined(ANDROID)
46
46
  } // namespace facebook::react
@@ -29,14 +29,14 @@ class JSI_EXPORT RNSScreenStackHeaderConfigShadowNode final
29
29
 
30
30
  #pragma mark - Custom interface
31
31
 
32
- #if !defined(ANDROID) && !defined(NDEBUG)
32
+ #if !defined(ANDROID)
33
33
  void setImageLoader(std::weak_ptr<void> imageLoader);
34
34
  #endif // !ANDROID && !NDEBUG
35
35
 
36
36
  private:
37
37
  void applyFrameCorrections();
38
38
 
39
- #if !defined(ANDROID) && !defined(NDEBUG)
39
+ #if !defined(ANDROID)
40
40
  StateData &getStateDataMutable();
41
41
  #endif // !ANDROID && !NDEBUG
42
42
  };
@@ -11,7 +11,6 @@ folly::dynamic RNSScreenStackHeaderConfigState::getDynamic() const {
11
11
  "paddingEnd", paddingEnd);
12
12
  }
13
13
  #else // ANDROID
14
- #ifndef NDEBUG
15
14
  void RNSScreenStackHeaderConfigState::setImageLoader(
16
15
  std::weak_ptr<void> imageLoader) {
17
16
  imageLoader_ = imageLoader;
@@ -21,7 +20,6 @@ std::weak_ptr<void> RNSScreenStackHeaderConfigState::getImageLoader()
21
20
  const noexcept {
22
21
  return imageLoader_;
23
22
  }
24
- #endif // !NDEBUG
25
23
  #endif // ANDROID
26
24
 
27
25
  } // namespace react
@@ -62,10 +62,8 @@ class JSI_EXPORT RNSScreenStackHeaderConfigState final {
62
62
  return MapBufferBuilder::EMPTY();
63
63
  };
64
64
  #else // ANDROID
65
- #if !defined(NDEBUG)
66
65
  void setImageLoader(std::weak_ptr<void> imageLoader);
67
66
  std::weak_ptr<void> getImageLoader() const noexcept;
68
- #endif // !NDEBUG
69
67
  #endif // ANDROID
70
68
 
71
69
  Size frameSize{};
@@ -82,9 +80,9 @@ class JSI_EXPORT RNSScreenStackHeaderConfigState final {
82
80
  #pragma mark - Getters
83
81
 
84
82
  private:
85
- #if !defined(ANDROID) && !defined(NDEBUG)
83
+ #if !defined(ANDROID)
86
84
  std::weak_ptr<void> imageLoader_;
87
- #endif // !ANDROID && !NDEBUG
85
+ #endif // !ANDROID
88
86
  };
89
87
 
90
88
  } // namespace facebook::react
@@ -10,12 +10,10 @@
10
10
  #import <react/renderer/components/rnscreens/EventEmitters.h>
11
11
  #import <react/renderer/components/rnscreens/Props.h>
12
12
  #import <react/renderer/components/rnscreens/RCTComponentViewHelpers.h>
13
+ #import <react/utils/ManagedObjectWrapper.h>
13
14
  #import <rnscreens/RNSScreenStackHeaderConfigComponentDescriptor.h>
14
15
  #import "RCTImageComponentView+RNSScreenStackHeaderConfig.h"
15
16
  #import "UINavigationBar+RNSUtility.h"
16
- #ifndef NDEBUG
17
- #import <react/utils/ManagedObjectWrapper.h>
18
- #endif // !NDEBUG
19
17
  #else
20
18
  #import <React/RCTImageView.h>
21
19
  #import <React/RCTShadowView.h>
@@ -82,9 +80,7 @@ static constexpr auto DEFAULT_TITLE_LARGE_FONT_SIZE = @34;
82
80
  /// Whether a react subview has been added / removed in current transaction. This flag is reset after each react
83
81
  /// transaction via RCTMountingTransactionObserving protocol.
84
82
  bool _addedReactSubviewsInCurrentTransaction;
85
- #ifndef NDEBUG
86
- RCTImageLoader *imageLoader;
87
- #endif // !NDEBUG
83
+ RCTImageLoader *_imageLoader;
88
84
  #else
89
85
  NSDirectionalEdgeInsets _lastHeaderInsets;
90
86
  __weak RCTBridge *_bridge;
@@ -376,7 +372,9 @@ RNS_IGNORE_SUPER_CALL_END
376
372
  // in DEV MODE we try to load from cache (we use private API for that as it is not exposed
377
373
  // publically in headers).
378
374
  RCTImageSource *imageSource = [RNSScreenStackHeaderConfig imageSourceFromImageView:imageView];
379
- #ifndef RCT_NEW_ARCH_ENABLED
375
+ #ifdef RCT_NEW_ARCH_ENABLED
376
+ RCTImageLoader *imageLoader = _imageLoader;
377
+ #else
380
378
  RCTImageLoader *imageLoader = [_bridge moduleForClass:[RCTImageLoader class]];
381
379
  #endif // !RCT_NEW_ARCH_ENABLED
382
380
  image = [imageLoader.imageCache
@@ -883,7 +881,7 @@ RNS_IGNORE_SUPER_CALL_END
883
881
  #endif
884
882
  }
885
883
  #if RCT_NEW_ARCH_ENABLED
886
- imageLoader:imageLoader];
884
+ imageLoader:_imageLoader];
887
885
  #else
888
886
  imageLoader:_bridge.imageLoader];
889
887
  #endif
@@ -1190,11 +1188,9 @@ static RCTResizeMode resizeModeFromCppEquiv(react::ImageResizeMode resizeMode)
1190
1188
  oldState:(const facebook::react::State::Shared &)oldState
1191
1189
  {
1192
1190
  _state = std::static_pointer_cast<const react::RNSScreenStackHeaderConfigShadowNode::ConcreteState>(state);
1193
- #ifndef NDEBUG
1194
1191
  if (auto imgLoaderPtr = _state.get()->getData().getImageLoader().lock()) {
1195
- imageLoader = react::unwrapManagedObject(imgLoaderPtr);
1192
+ _imageLoader = react::unwrapManagedObject(imgLoaderPtr);
1196
1193
  }
1197
- #endif // !NDEBUG
1198
1194
  }
1199
1195
 
1200
1196
  #else
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-screens",
3
- "version": "4.17.0",
3
+ "version": "4.17.1",
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 ../)",