react-native-reanimated 3.16.5 → 3.16.7

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.
@@ -27,23 +27,31 @@ ReanimatedCommitHook::~ReanimatedCommitHook() noexcept {
27
27
  uiManager_->unregisterCommitHook(*this);
28
28
  }
29
29
 
30
+ void ReanimatedCommitHook::maybeInitializeLayoutAnimations(
31
+ SurfaceId surfaceId) {
32
+ auto lock = std::unique_lock<std::mutex>(mutex_);
33
+ if (surfaceId > currentMaxSurfaceId_) {
34
+ // when a new surfaceId is observed we call setMountingOverrideDelegate
35
+ // for all yet unseen surfaces
36
+ uiManager_->getShadowTreeRegistry().enumerate(
37
+ [this](const ShadowTree &shadowTree, bool &stop) {
38
+ if (shadowTree.getSurfaceId() <= currentMaxSurfaceId_) {
39
+ // the set function actually adds our delegate to a list, so we
40
+ // shouldn't invoke it twice for the same surface
41
+ return;
42
+ }
43
+ shadowTree.getMountingCoordinator()->setMountingOverrideDelegate(
44
+ layoutAnimationsProxy_);
45
+ });
46
+ currentMaxSurfaceId_ = surfaceId;
47
+ }
48
+ }
49
+
30
50
  RootShadowNode::Unshared ReanimatedCommitHook::shadowTreeWillCommit(
31
51
  ShadowTree const &,
32
52
  RootShadowNode::Shared const &,
33
53
  RootShadowNode::Unshared const &newRootShadowNode) noexcept {
34
- auto surfaceId = newRootShadowNode->getSurfaceId();
35
-
36
- {
37
- auto lock = std::unique_lock<std::mutex>(mutex_);
38
- if (surfaceId > currentMaxSurfaceId_) {
39
- uiManager_->getShadowTreeRegistry().enumerate(
40
- [this](const ShadowTree &shadowTree, bool &stop) {
41
- shadowTree.getMountingCoordinator()->setMountingOverrideDelegate(
42
- layoutAnimationsProxy_);
43
- });
44
- currentMaxSurfaceId_ = surfaceId;
45
- }
46
- }
54
+ maybeInitializeLayoutAnimations(newRootShadowNode->getSurfaceId());
47
55
 
48
56
  auto reaShadowNode =
49
57
  std::reinterpret_pointer_cast<ReanimatedCommitShadowNode>(
@@ -42,6 +42,8 @@ class ReanimatedCommitHook : public UIManagerCommitHook {
42
42
  const noexcept override;
43
43
  #endif
44
44
 
45
+ void maybeInitializeLayoutAnimations(SurfaceId surfaceId);
46
+
45
47
  private:
46
48
  std::shared_ptr<PropsRegistry> propsRegistry_;
47
49
 
@@ -22,7 +22,7 @@
22
22
  #include <react/renderer/scheduler/Scheduler.h>
23
23
  #include <react/renderer/uimanager/UIManagerBinding.h>
24
24
  #include <react/renderer/uimanager/primitives.h>
25
- #if REACT_NATIVE_MINOR_VERSION >= 73
25
+ #if REACT_NATIVE_MINOR_VERSION == 73 && defined(RCT_NEW_ARCH_ENABLED)
26
26
  #include <react/utils/CoreFeatures.h>
27
27
  #endif // REACT_NATIVE_MINOR_VERSION
28
28
  #endif // RCT_NEW_ARCH_ENABLED
@@ -368,7 +368,7 @@ jsi::Value NativeReanimatedModule::getViewProp(
368
368
  const auto funPtr = std::make_shared<jsi::Function>(
369
369
  callback.getObject(rnRuntime).asFunction(rnRuntime));
370
370
  const auto shadowNode = shadowNodeFromValue(rnRuntime, shadowNodeWrapper);
371
- uiScheduler_->scheduleOnUI([=]() {
371
+ uiScheduler_->scheduleOnUI(COPY_CAPTURE_WITH_THIS {
372
372
  jsi::Runtime &uiRuntime = uiWorkletRuntime_->getJSIRuntime();
373
373
  const auto resultStr =
374
374
  obtainPropFromShadowNode(uiRuntime, propNameStr, shadowNode);
@@ -770,10 +770,7 @@ void NativeReanimatedModule::performOperations() {
770
770
  },
771
771
  {/* .enableStateReconciliation = */
772
772
  false,
773
- /* .mountSynchronously = */ true,
774
- /* .shouldYield = */ [this]() {
775
- return propsRegistry_->shouldReanimatedSkipCommit();
776
- }});
773
+ /* .mountSynchronously = */ true});
777
774
  });
778
775
  }
779
776
 
@@ -118,7 +118,7 @@ elseif(${JS_RUNTIME} STREQUAL "v8")
118
118
  PRIVATE
119
119
  "${JS_RUNTIME_DIR}/src"
120
120
  )
121
- file(GLOB V8_SO_DIR "${JS_RUNTIME_DIR}/android/build/intermediates/library_jni/*/jni/${ANDROID_ABI}")
121
+ file(GLOB V8_SO_DIR "${JS_RUNTIME_DIR}/android/build/intermediates/library_jni/**/jni/${ANDROID_ABI}")
122
122
  find_library(
123
123
  V8EXECUTOR_LIB
124
124
  v8executor
@@ -58,7 +58,7 @@ public class ReanimatedPackage extends TurboReactPackage implements ReactPackage
58
58
  new ReactModuleInfo(
59
59
  reactModule.name(),
60
60
  moduleClass.getName(),
61
- true,
61
+ true, // override UIManagerModule
62
62
  reactModule.needsEagerInit(),
63
63
  reactModule.isCxxModule(),
64
64
  BuildConfig.IS_NEW_ARCHITECTURE_ENABLED));
@@ -1,9 +1,13 @@
1
1
  #ifdef RCT_NEW_ARCH_ENABLED
2
+ #if REACT_NATIVE_MINOR_VERSION >= 77
3
+ #import <React/RCTCallInvokerModule.h>
4
+ #else
2
5
  #import <React/RCTInitializing.h>
3
6
  #if REACT_NATIVE_MINOR_VERSION >= 74
4
7
  #import <React/RCTRuntimeExecutorModule.h>
5
8
  #import <ReactCommon/RCTRuntimeExecutor.h>
6
9
  #endif // REACT_NATIVE_MINOR_VERSION >= 74
10
+ #endif // REACT_NATIVE_MINOR_VERSION >= 77
7
11
  #import <rnreanimated/rnreanimated.h>
8
12
  #else // RCT_NEW_ARCH_ENABLED
9
13
  #import <React/RCTBridgeModule.h>
@@ -20,10 +24,14 @@
20
24
  @interface REAModule : RCTEventEmitter
21
25
  #ifdef RCT_NEW_ARCH_ENABLED
22
26
  <NativeReanimatedModuleSpec,
27
+ #if REACT_NATIVE_MINOR_VERSION >= 77
28
+ RCTCallInvokerModule,
29
+ #else
23
30
  RCTInitializing,
24
31
  #if REACT_NATIVE_MINOR_VERSION >= 74
25
32
  RCTRuntimeExecutorModule,
26
33
  #endif // REACT_NATIVE_MINOR_VERSION >= 74
34
+ #endif // REACT_NATIVE_MINOR_VERSION >= 77
27
35
  #else
28
36
  <RCTBridgeModule,
29
37
  #endif // RCT_NEW_ARCH_ENABLED
@@ -1,6 +1,9 @@
1
1
  #import <React/RCTBridge+Private.h>
2
2
 
3
3
  #ifdef RCT_NEW_ARCH_ENABLED
4
+ #if REACT_NATIVE_MINOR_VERSION >= 77
5
+ #import <React/RCTCallInvoker.h>
6
+ #endif // REACT_NATIVE_MINOR_VERSION >= 77
4
7
  #import <React/RCTFabricSurface.h>
5
8
  #import <React/RCTScheduler.h>
6
9
  #import <React/RCTSurface.h>
@@ -64,9 +67,11 @@ typedef void (^AnimatedOperation)(REANodesManager *nodesManager);
64
67
  }
65
68
 
66
69
  @synthesize moduleRegistry = _moduleRegistry;
67
- #if REACT_NATIVE_MINOR_VERSION >= 74 && defined(RCT_NEW_ARCH_ENABLED)
70
+ #if REACT_NATIVE_MINOR_VERSION >= 77 && defined(RCT_NEW_ARCH_ENABLED)
71
+ @synthesize callInvoker = _callInvoker;
72
+ #elif REACT_NATIVE_MINOR_VERSION >= 74 && defined(RCT_NEW_ARCH_ENABLED)
68
73
  @synthesize runtimeExecutor = _runtimeExecutor;
69
- #endif // REACT_NATIVE_MINOR_VERSION >= 74 && defined(RCT_NEW_ARCH_ENABLED)
74
+ #endif
70
75
 
71
76
  RCT_EXPORT_MODULE(ReanimatedModule);
72
77
 
@@ -285,6 +290,10 @@ RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(installTurboModule : (nonnull NSString *)
285
290
  #if REACT_NATIVE_MINOR_VERSION >= 74 && defined(RCT_NEW_ARCH_ENABLED)
286
291
  RCTCxxBridge *cxxBridge = (RCTCxxBridge *)self.bridge;
287
292
  auto &rnRuntime = *(jsi::Runtime *)cxxBridge.runtime;
293
+ #if REACT_NATIVE_MINOR_VERSION >= 77
294
+ auto nativeReanimatedModule = reanimated::createReanimatedModuleBridgeless(
295
+ _moduleRegistry, rnRuntime, std::string([valueUnpackerCode UTF8String]), _callInvoker.callInvoker);
296
+ #else
288
297
  auto executorFunction = ([executor = _runtimeExecutor](std::function<void(jsi::Runtime & runtime)> &&callback) {
289
298
  // Convert to Objective-C block so it can be captured properly.
290
299
  __block auto callbackBlock = callback;
@@ -295,6 +304,7 @@ RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(installTurboModule : (nonnull NSString *)
295
304
  });
296
305
  auto nativeReanimatedModule = reanimated::createReanimatedModuleBridgeless(
297
306
  _moduleRegistry, rnRuntime, std::string([valueUnpackerCode UTF8String]), executorFunction);
307
+ #endif
298
308
  [self attachReactEventListener];
299
309
  [self commonInit:nativeReanimatedModule withRnRuntime:rnRuntime];
300
310
  #else // REACT_NATIVE_MINOR_VERSION >= 74 && defined(RCT_NEW_ARCH_ENABLED)
@@ -25,7 +25,12 @@ createReanimatedModuleBridgeless(
25
25
  RCTModuleRegistry *moduleRegistry,
26
26
  jsi::Runtime &runtime,
27
27
  const std::string &valueUnpackerCode,
28
- RuntimeExecutor runtimeExecutor);
28
+ #if REACT_NATIVE_MINOR_VERSION >= 77
29
+ const std::shared_ptr<facebook::react::CallInvoker> &callInvoker
30
+ #else
31
+ RuntimeExecutor runtimeExecutor
32
+ #endif
33
+ );
29
34
  #endif // REACT_NATIVE_MINOR_VERSION >= 74 && defined(RCT_NEW_ARCH_ENABLED)
30
35
 
31
36
  void commonInit(
@@ -103,7 +103,12 @@ std::shared_ptr<NativeReanimatedModule> createReanimatedModuleBridgeless(
103
103
  RCTModuleRegistry *moduleRegistry,
104
104
  jsi::Runtime &runtime,
105
105
  const std::string &valueUnpackerCode,
106
- RuntimeExecutor runtimeExecutor)
106
+ #if REACT_NATIVE_MINOR_VERSION >= 77
107
+ const std::shared_ptr<facebook::react::CallInvoker> &callInvoker
108
+ #else
109
+ RuntimeExecutor runtimeExecutor
110
+ #endif
111
+ )
107
112
  {
108
113
  REAModule *reaModule = [moduleRegistry moduleForName:"ReanimatedModule"];
109
114
 
@@ -117,7 +122,13 @@ std::shared_ptr<NativeReanimatedModule> createReanimatedModuleBridgeless(
117
122
  makePlatformDepMethodsHolderBridgeless(moduleRegistry, nodesManager, reaModule);
118
123
 
119
124
  auto uiScheduler = std::make_shared<REAIOSUIScheduler>();
125
+
126
+ #if REACT_NATIVE_MINOR_VERSION >= 77
127
+ auto jsScheduler = std::make_shared<JSScheduler>(runtime, callInvoker);
128
+ #else
120
129
  auto jsScheduler = std::make_shared<JSScheduler>(runtime, runtimeExecutor);
130
+ #endif
131
+
121
132
  constexpr auto isBridgeless = true;
122
133
 
123
134
  auto nativeReanimatedModule = std::make_shared<NativeReanimatedModule>(
@@ -4,6 +4,9 @@
4
4
  import { ReanimatedError } from "../errors.js";
5
5
  import { isFabric } from "../PlatformChecker.js";
6
6
  function findHostInstanceFastPath(maybeNativeRef) {
7
+ if (!maybeNativeRef) {
8
+ return undefined;
9
+ }
7
10
  if (maybeNativeRef.__internalInstanceHandle && maybeNativeRef.__nativeTag && maybeNativeRef._viewConfig) {
8
11
  // This is a native ref to a Fabric component
9
12
  return maybeNativeRef;
@@ -22,12 +25,18 @@ function resolveFindHostInstance_DEPRECATED() {
22
25
  }
23
26
  if (isFabric()) {
24
27
  try {
25
- findHostInstance_DEPRECATED = require('react-native/Libraries/Renderer/shims/ReactFabric').findHostInstance_DEPRECATED;
28
+ const ReactFabric = require('react-native/Libraries/Renderer/shims/ReactFabric');
29
+ // Since RN 0.77 ReactFabric exports findHostInstance_DEPRECATED in default object so we're trying to
30
+ // access it first, then fallback on named export
31
+ findHostInstance_DEPRECATED = ReactFabric?.default?.findHostInstance_DEPRECATED ?? ReactFabric?.findHostInstance_DEPRECATED;
26
32
  } catch (e) {
27
33
  throw new ReanimatedError('Failed to resolve findHostInstance_DEPRECATED');
28
34
  }
29
35
  } else {
30
- findHostInstance_DEPRECATED = require('react-native/Libraries/Renderer/shims/ReactNative').findHostInstance_DEPRECATED;
36
+ const ReactNative = require('react-native/Libraries/Renderer/shims/ReactNative');
37
+ // Since RN 0.77 ReactFabric exports findHostInstance_DEPRECATED in default object so we're trying to
38
+ // access it first, then fallback on named export
39
+ findHostInstance_DEPRECATED = ReactNative?.default?.findHostInstance_DEPRECATED ?? ReactNative?.findHostInstance_DEPRECATED;
31
40
  }
32
41
  }
33
42
  let findHostInstance_DEPRECATED;
@@ -1 +1 @@
1
- {"version":3,"names":["ReanimatedError","isFabric","findHostInstanceFastPath","maybeNativeRef","__internalInstanceHandle","__nativeTag","_viewConfig","_nativeTag","viewConfig","undefined","resolveFindHostInstance_DEPRECATED","findHostInstance_DEPRECATED","require","e","findHostInstance","component","hostInstance","_componentRef"],"sourceRoot":"../../../src","sources":["platform-specific/findHostInstance.ts"],"mappings":"AAAA;AACA,YAAY;;AAGZ,SAASA,eAAe,QAAQ,cAAW;AAC3C,SAASC,QAAQ,QAAQ,uBAAoB;AAe7C,SAASC,wBAAwBA,CAACC,cAA4B,EAAE;EAC9D,IACEA,cAAc,CAACC,wBAAwB,IACvCD,cAAc,CAACE,WAAW,IAC1BF,cAAc,CAACG,WAAW,EAC1B;IACA;IACA,OAAOH,cAAc;EACvB;EACA,IAAIA,cAAc,CAACI,UAAU,IAAIJ,cAAc,CAACK,UAAU,EAAE;IAC1D;IACA,OAAOL,cAAc;EACvB;EACA;EACA;EACA,OAAOM,SAAS;AAClB;AAEA,SAASC,kCAAkCA,CAAA,EAAG;EAC5C,IAAIC,2BAA2B,KAAKF,SAAS,EAAE;IAC7C;EACF;EACA,IAAIR,QAAQ,CAAC,CAAC,EAAE;IACd,IAAI;MACFU,2BAA2B,GACzBC,OAAO,CAAC,mDAAmD,CAAC,CAACD,2BAA2B;IAC5F,CAAC,CAAC,OAAOE,CAAC,EAAE;MACV,MAAM,IAAIb,eAAe,CACvB,+CACF,CAAC;IACH;EACF,CAAC,MAAM;IACLW,2BAA2B,GACzBC,OAAO,CAAC,mDAAmD,CAAC,CAACD,2BAA2B;EAC5F;AACF;AAEA,IAAIA,2BAA2D;AAC/D,OAAO,SAASG,gBAAgBA,CAC9BC,SAAuD,EACzC;EACd;EACA,MAAMC,YAAY,GAAGd,wBAAwB,CAC1Ca,SAAS,CAAgCE,aAC5C,CAAC;EACD,IAAID,YAAY,KAAKP,SAAS,EAAE;IAC9B,OAAOO,YAAY;EACrB;EAEAN,kCAAkC,CAAC,CAAC;EACpC;EACA,OAAOC,2BAA2B,CAChCV,QAAQ,CAAC,CAAC,GACNc,SAAS,GACRA,SAAS,CAAgCE,aAChD,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"names":["ReanimatedError","isFabric","findHostInstanceFastPath","maybeNativeRef","undefined","__internalInstanceHandle","__nativeTag","_viewConfig","_nativeTag","viewConfig","resolveFindHostInstance_DEPRECATED","findHostInstance_DEPRECATED","ReactFabric","require","default","e","ReactNative","findHostInstance","component","hostInstance","_componentRef"],"sourceRoot":"../../../src","sources":["platform-specific/findHostInstance.ts"],"mappings":"AAAA;AACA,YAAY;;AAGZ,SAASA,eAAe,QAAQ,cAAW;AAC3C,SAASC,QAAQ,QAAQ,uBAAoB;AAe7C,SAASC,wBAAwBA,CAACC,cAAwC,EAAE;EAC1E,IAAI,CAACA,cAAc,EAAE;IACnB,OAAOC,SAAS;EAClB;EACA,IACED,cAAc,CAACE,wBAAwB,IACvCF,cAAc,CAACG,WAAW,IAC1BH,cAAc,CAACI,WAAW,EAC1B;IACA;IACA,OAAOJ,cAAc;EACvB;EACA,IAAIA,cAAc,CAACK,UAAU,IAAIL,cAAc,CAACM,UAAU,EAAE;IAC1D;IACA,OAAON,cAAc;EACvB;EACA;EACA;EACA,OAAOC,SAAS;AAClB;AAEA,SAASM,kCAAkCA,CAAA,EAAG;EAC5C,IAAIC,2BAA2B,KAAKP,SAAS,EAAE;IAC7C;EACF;EACA,IAAIH,QAAQ,CAAC,CAAC,EAAE;IACd,IAAI;MACF,MAAMW,WAAW,GAAGC,OAAO,CAAC,mDAAmD,CAAC;MAChF;MACA;MACAF,2BAA2B,GACzBC,WAAW,EAAEE,OAAO,EAAEH,2BAA2B,IACjDC,WAAW,EAAED,2BAA2B;IAC5C,CAAC,CAAC,OAAOI,CAAC,EAAE;MACV,MAAM,IAAIf,eAAe,CACvB,+CACF,CAAC;IACH;EACF,CAAC,MAAM;IACL,MAAMgB,WAAW,GAAGH,OAAO,CAAC,mDAAmD,CAAC;IAChF;IACA;IACAF,2BAA2B,GACzBK,WAAW,EAAEF,OAAO,EAAEH,2BAA2B,IACjDK,WAAW,EAAEL,2BAA2B;EAC5C;AACF;AAEA,IAAIA,2BAA2D;AAC/D,OAAO,SAASM,gBAAgBA,CAC9BC,SAAuD,EACzC;EACd;EACA,MAAMC,YAAY,GAAGjB,wBAAwB,CAC1CgB,SAAS,CAAgCE,aAC5C,CAAC;EACD,IAAID,YAAY,KAAKf,SAAS,EAAE;IAC9B,OAAOe,YAAY;EACrB;EAEAT,kCAAkC,CAAC,CAAC;EACpC;EACA,OAAOC,2BAA2B,CAChCV,QAAQ,CAAC,CAAC,GACNiB,SAAS,GACRA,SAAS,CAAgCE,aAChD,CAAC;AACH","ignoreList":[]}
@@ -5,5 +5,5 @@
5
5
  * version used to build the native part of the library in runtime. Remember to
6
6
  * keep this in sync with the version declared in `package.json`
7
7
  */
8
- export const jsVersion = '3.16.5';
8
+ export const jsVersion = '3.16.7';
9
9
  //# sourceMappingURL=jsVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"findHostInstance.d.ts","sourceRoot":"","sources":["../../../src/platform-specific/findHostInstance.ts"],"names":[],"mappings":";AAGA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,wCAAwC,CAAC;AAIzF,KAAK,kBAAkB,GAAG;IACxB,wBAAwB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACvC,CAAC;AAEF,KAAK,iBAAiB,GAAG;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,kBAAkB,GAAG,iBAAiB,CAAC;AAwClE,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,0BAA0B,GAAG,KAAK,CAAC,SAAS,GACtD,YAAY,CAgBd"}
1
+ {"version":3,"file":"findHostInstance.d.ts","sourceRoot":"","sources":["../../../src/platform-specific/findHostInstance.ts"],"names":[],"mappings":";AAGA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,wCAAwC,CAAC;AAIzF,KAAK,kBAAkB,GAAG;IACxB,wBAAwB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACvC,CAAC;AAEF,KAAK,iBAAiB,GAAG;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,kBAAkB,GAAG,iBAAiB,CAAC;AAmDlE,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,0BAA0B,GAAG,KAAK,CAAC,SAAS,GACtD,YAAY,CAgBd"}
@@ -3,5 +3,5 @@
3
3
  * version used to build the native part of the library in runtime. Remember to
4
4
  * keep this in sync with the version declared in `package.json`
5
5
  */
6
- export declare const jsVersion = "3.16.5";
6
+ export declare const jsVersion = "3.16.7";
7
7
  //# sourceMappingURL=jsVersion.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-reanimated",
3
- "version": "3.16.5",
3
+ "version": "3.16.7",
4
4
  "description": "More powerful alternative to Animated library for React Native.",
5
5
  "scripts": {
6
6
  "test": "jest",
@@ -18,7 +18,10 @@ type HostInstancePaper = {
18
18
 
19
19
  export type HostInstance = HostInstanceFabric & HostInstancePaper;
20
20
 
21
- function findHostInstanceFastPath(maybeNativeRef: HostInstance) {
21
+ function findHostInstanceFastPath(maybeNativeRef: HostInstance | undefined) {
22
+ if (!maybeNativeRef) {
23
+ return undefined;
24
+ }
22
25
  if (
23
26
  maybeNativeRef.__internalInstanceHandle &&
24
27
  maybeNativeRef.__nativeTag &&
@@ -42,16 +45,24 @@ function resolveFindHostInstance_DEPRECATED() {
42
45
  }
43
46
  if (isFabric()) {
44
47
  try {
48
+ const ReactFabric = require('react-native/Libraries/Renderer/shims/ReactFabric');
49
+ // Since RN 0.77 ReactFabric exports findHostInstance_DEPRECATED in default object so we're trying to
50
+ // access it first, then fallback on named export
45
51
  findHostInstance_DEPRECATED =
46
- require('react-native/Libraries/Renderer/shims/ReactFabric').findHostInstance_DEPRECATED;
52
+ ReactFabric?.default?.findHostInstance_DEPRECATED ??
53
+ ReactFabric?.findHostInstance_DEPRECATED;
47
54
  } catch (e) {
48
55
  throw new ReanimatedError(
49
56
  'Failed to resolve findHostInstance_DEPRECATED'
50
57
  );
51
58
  }
52
59
  } else {
60
+ const ReactNative = require('react-native/Libraries/Renderer/shims/ReactNative');
61
+ // Since RN 0.77 ReactFabric exports findHostInstance_DEPRECATED in default object so we're trying to
62
+ // access it first, then fallback on named export
53
63
  findHostInstance_DEPRECATED =
54
- require('react-native/Libraries/Renderer/shims/ReactNative').findHostInstance_DEPRECATED;
64
+ ReactNative?.default?.findHostInstance_DEPRECATED ??
65
+ ReactNative?.findHostInstance_DEPRECATED;
55
66
  }
56
67
  }
57
68
 
@@ -4,4 +4,4 @@
4
4
  * version used to build the native part of the library in runtime. Remember to
5
5
  * keep this in sync with the version declared in `package.json`
6
6
  */
7
- export const jsVersion = '3.16.5';
7
+ export const jsVersion = '3.16.7';