Minimal support for other platforms

Such as web, windows...
This commit is contained in:
Louis Lagrange
2018-09-24 22:06:40 +02:00
committed by GitHub
parent b9938ada36
commit 118068ed13

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) {