Merge pull request #16 from Minishlink/patch-1

Minimal support for other platforms
This commit is contained in:
Krzysztof Magiera
2018-09-25 08:28:53 +02:00
committed by GitHub

View File

@@ -5,6 +5,7 @@ import {
View,
UIManager,
StyleSheet,
Platform,
} from 'react-native';
let USE_SCREENS = false;
@@ -22,14 +23,16 @@ export function screensEnabled() {
return USE_SCREENS;
}
const NativeScreen = Animated.createAnimatedComponent(
requireNativeComponent('RNSScreen', null)
);
const isPlatformSupported = ['android', 'ios'].includes(Platform.OS);
const NativeScreenContainer = requireNativeComponent(
const NativeScreen = isPlatformSupported ? Animated.createAnimatedComponent(
requireNativeComponent('RNSScreen', null)
) : null;
const NativeScreenContainer = isPlatformSupported ? requireNativeComponent(
'RNSScreenContainer',
null
);
) : null;
export class Screen extends React.Component {
setNativeProps(props) {