Expo Module for rendering React Native content on an external display in native iOS and Android apps.
This project is inspired by the normal external-display rendering approach in react-native-external-display, but it is a standalone Expo Module rather than a wrapper around that package.
npx expo install @isvend/expo-external-displayThis package is native-only and supports iOS and Android. It does not support web.
import React from 'react';
import { Text, View } from 'react-native';
import ExternalDisplay, { useExternalDisplay } from '@isvend/expo-external-display';
export default function App() {
const screens = useExternalDisplay();
const screen = Object.keys(screens)[0];
return (
<ExternalDisplay
mainScreenStyle={{ flex: 1 }}
fallbackInMainScreen
screen={screen}
>
<View
style={{
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#333',
}}
>
<Text style={{ color: 'red', fontSize: 40 }}>External Display</Text>
</View>
</ExternalDisplay>
);
}Returns the cached external display map.
type Screen = {
id: string | number;
width: number;
height: number;
mirrored?: boolean;
};
type ScreenInfo = Record<string, Screen>;React hook that subscribes to external display changes.
useExternalDisplay({
onScreenConnect: (screens) => {},
onScreenChange: (screens) => {},
onScreenDisconnect: (screens) => {},
});Returns the screen currently used by the nearest <ExternalDisplay />. It returns null when the children are rendered as a fallback on the main screen.
Props:
screen?: stringfallbackInMainScreen?: booleanmainScreenStyle?: StyleProp<ViewStyle>- all React Native
ViewProps
Automated tests cover the JavaScript layer:
npm test -- --runInBand
npm run build
npm run lintNative display behavior should be validated through the included Expo app:
cd example
npm install
npm run prebuild
npm run ios
# or
npm run androidThe example uses @isvend/expo-external-display through file:.., renders the external surface with fallbackInMainScreen, and prints the detected getScreens() result on the main screen.
Manual device coverage:
- Android device/emulator with a presentation-capable secondary display
- iOS device/simulator with an external display