diff --git a/packages/react-native-external-display/index.js b/packages/react-native-external-display/index.js index 310c5a1d..7152b5b4 100644 --- a/packages/react-native-external-display/index.js +++ b/packages/react-native-external-display/index.js @@ -31,18 +31,21 @@ type Props = { onScreenDisconnect?: Function, } -const ExternalDisplayView = (props: Props) => { - const { - screen, - fallbackInMainScreen, - mainScreenStyle, - style, +const ExternalDisplayView = ({ + style = undefined, + mainScreenStyle = undefined, + screen = '', + fallbackInMainScreen = false, + onScreenConnect = () => {}, + onScreenChange = () => {}, + onScreenDisconnect = () => {}, + ...nativeProps +}: Props) => { + const screens = useExternalDisplay({ onScreenConnect, onScreenChange, onScreenDisconnect, - ...nativeProps - } = props - const screens = useExternalDisplay(props) + }) const scr = screens[screen] if (!scr && !fallbackInMainScreen) { return null @@ -68,16 +71,6 @@ const ExternalDisplayView = (props: Props) => { ) } -ExternalDisplayView.defaultProps = { - style: undefined, - mainScreenStyle: undefined, - screen: '', - fallbackInMainScreen: false, - onScreenConnect: () => {}, - onScreenChange: () => {}, - onScreenDisconnect: () => {}, -} - export { getScreens, useExternalDisplay, SceneManager } export default ExternalDisplayView