@@ -2,6 +2,8 @@ import type { ComponentType } from "react";
22import type { NativeSyntheticEvent , ViewProps } from "react-native" ;
33import { requireNativeView } from "expo" ;
44
5+ import { NativeViewResolutionError } from "../../native/nativeViewResolutionError" ;
6+
57const NATIVE_TERMINAL_MODULE_NAME = "T3TerminalSurface" ;
68
79interface ExpoGlobalWithViewConfig {
@@ -33,6 +35,7 @@ export interface NativeTerminalSurfaceProps extends ViewProps {
3335}
3436
3537let cachedNativeTerminalSurfaceView : ComponentType < NativeTerminalSurfaceProps > | undefined ;
38+ let nativeTerminalSurfaceViewResolutionFailed = false ;
3639
3740function getExpoViewConfig ( moduleName : string ) {
3841 return ( globalThis as typeof globalThis & ExpoGlobalWithViewConfig ) . expo ?. getViewConfig ?.(
@@ -45,6 +48,10 @@ export function resolveNativeTerminalSurfaceView(): ComponentType<NativeTerminal
4548 return cachedNativeTerminalSurfaceView ;
4649 }
4750
51+ if ( nativeTerminalSurfaceViewResolutionFailed ) {
52+ return null ;
53+ }
54+
4855 if ( getExpoViewConfig ( NATIVE_TERMINAL_MODULE_NAME ) == null ) {
4956 return null ;
5057 }
@@ -53,7 +60,14 @@ export function resolveNativeTerminalSurfaceView(): ComponentType<NativeTerminal
5360 cachedNativeTerminalSurfaceView = requireNativeView < NativeTerminalSurfaceProps > (
5461 NATIVE_TERMINAL_MODULE_NAME ,
5562 ) ;
56- } catch {
63+ } catch ( cause ) {
64+ nativeTerminalSurfaceViewResolutionFailed = true ;
65+ console . error (
66+ new NativeViewResolutionError ( {
67+ nativeModuleName : NATIVE_TERMINAL_MODULE_NAME ,
68+ cause,
69+ } ) ,
70+ ) ;
5771 return null ;
5872 }
5973
0 commit comments