Skip to content

Commit 3ba2472

Browse files
authored
fix: update architecture checks to use isFabricEnabled in RoktLayoutView iOS (#226)
1 parent 69689c9 commit 3ba2472

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

js/rokt/rokt-layout-view.ios.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@ import {
33
StyleSheet,
44
NativeEventEmitter,
55
NativeModules,
6-
HostComponent,
76
ViewProps,
87
NativeModule,
9-
UIManager,
108
} from 'react-native';
119
import React, { Component } from 'react';
12-
import { isNewArchitecture } from '../utils/architecture';
10+
import { isFabricEnabled } from '../utils/architecture';
1311
import RoktLayoutNativeComponent from '../codegenSpecs/rokt/RoktLayoutNativeComponent';
1412

1513
const RoktEventManager = NativeModules.RoktEventManager as NativeModule;
@@ -52,7 +50,7 @@ interface RoktNativeLayoutProps extends ViewProps {
5250

5351
// Use the appropriate component based on architecture
5452
const LayoutNativeComponent = (
55-
isNewArchitecture
53+
isFabricEnabled
5654
? RoktLayoutNativeComponent
5755
: requireNativeComponent<RoktNativeLayoutProps>('RoktLegacyLayout')
5856
) as any;

js/utils/architecture.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@ import { NativeModules, TurboModuleRegistry, TurboModule } from 'react-native';
22

33
declare const global: {
44
__turboModuleProxy: unknown;
5+
nativeFabricUIManager: unknown;
56
};
67

78
export const isNewArchitecture = global.__turboModuleProxy != null;
89

10+
export const isFabricEnabled = global.nativeFabricUIManager != null;
11+
912
/**
1013
* Gets the native module for both old and new architectures
1114
* @param moduleName The name of the module

0 commit comments

Comments
 (0)