Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions js/rokt/rokt-layout-view.ios.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@ import {
StyleSheet,
NativeEventEmitter,
NativeModules,
HostComponent,
ViewProps,
NativeModule,
UIManager,
} from 'react-native';
import React, { Component } from 'react';
import { isNewArchitecture } from '../utils/architecture';
import { isFabricEnabled } from '../utils/architecture';
import RoktLayoutNativeComponent from '../codegenSpecs/rokt/RoktLayoutNativeComponent';

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

// Use the appropriate component based on architecture
const LayoutNativeComponent = (
isNewArchitecture
isFabricEnabled
? RoktLayoutNativeComponent
: requireNativeComponent<RoktNativeLayoutProps>('RoktLegacyLayout')
) as any;
Expand Down
3 changes: 3 additions & 0 deletions js/utils/architecture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@ import { NativeModules, TurboModuleRegistry, TurboModule } from 'react-native';

declare const global: {
__turboModuleProxy: unknown;
nativeFabricUIManager: unknown;
};

export const isNewArchitecture = global.__turboModuleProxy != null;

export const isFabricEnabled = global.nativeFabricUIManager != null;

/**
* Gets the native module for both old and new architectures
* @param moduleName The name of the module
Expand Down