Skip to content

Commit daec733

Browse files
committed
fix: update architecture checks to use isFabricEnabled in RoktLayoutView iOS
Load the legacy native view if Fabric components are not enabled.
1 parent 69689c9 commit daec733

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
UIManager,
1010
} from 'react-native';
1111
import React, { Component } from 'react';
12-
import { isNewArchitecture } from '../utils/architecture';
12+
import { isFabricEnabled } from '../utils/architecture';
1313
import RoktLayoutNativeComponent from '../codegenSpecs/rokt/RoktLayoutNativeComponent';
1414

1515
const RoktEventManager = NativeModules.RoktEventManager as NativeModule;
@@ -52,7 +52,7 @@ interface RoktNativeLayoutProps extends ViewProps {
5252

5353
// Use the appropriate component based on architecture
5454
const LayoutNativeComponent = (
55-
isNewArchitecture
55+
isFabricEnabled
5656
? RoktLayoutNativeComponent
5757
: requireNativeComponent<RoktNativeLayoutProps>('RoktLegacyLayout')
5858
) 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)