Fix react-native-web support for #3526 (#3546)

* MaskedViewIOS use broke react-native-web support, this fixes it.

* Fallback more gracefully.

* Actually return the value ...
This commit is contained in:
Ron Arts
2018-02-19 13:48:12 +01:00
committed by Satyajit Sahoo
parent 14ee56a20d
commit 3ca47ec778
3 changed files with 9 additions and 5 deletions

View File

@@ -1,8 +1,9 @@
import {
BackAndroid as DeprecatedBackAndroid,
BackHandler as ModernBackHandler,
MaskedViewIOS,
} from 'react-native';
const BackHandler = ModernBackHandler || DeprecatedBackAndroid;
export { BackHandler };
export { BackHandler, MaskedViewIOS };

View File

@@ -1,3 +1,6 @@
import { BackHandler } from 'react-native';
import React from 'react';
import { BackHandler, View } from 'react-native';
export { BackHandler };
const MaskedViewIOS = () => <View>{this.props.children}</View>;
export { BackHandler, MaskedViewIOS };

View File

@@ -6,10 +6,10 @@ import {
Image,
Platform,
StyleSheet,
MaskedViewIOS,
View,
ViewPropTypes,
} from 'react-native';
import { MaskedViewIOS } from '../../PlatformHelpers';
import SafeAreaView from 'react-native-safe-area-view';
import HeaderTitle from './HeaderTitle';
@@ -379,7 +379,7 @@ class Header extends React.PureComponent {
if (
options.headerLeft ||
options.headerBackImage ||
Platform.OS === 'android' ||
Platform.OS !== 'ios' ||
transitionPreset !== 'uikit'
) {
return (