Last active
May 17, 2018 19:34
-
-
Save rgommezz/fb215c006b665b8575317efd2d67232a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @flow | |
import React from 'react'; | |
import hoistNonReactStatics from 'hoist-non-react-statics'; | |
import SafeAreaView from '../../lib/react-native-safe-area-view'; | |
export default function withSafeAreaView( | |
WrappedComponent: ReactClass<*>, | |
): () => React.Element<*> { | |
function EnhancedComponent(props: any) { | |
return ( | |
<SafeAreaView style={{ flex: 1, backgroundColor: '#CCC' }}> | |
<WrappedComponent {...props} /> | |
</SafeAreaView> | |
); | |
} | |
return hoistNonReactStatics(EnhancedComponent, WrappedComponent); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment