Last active
September 6, 2017 02:40
-
-
Save fakenickels/b0720a1e0b8451204f6f89594ba59bc8 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
import React from 'react' | |
import { View, Text, Modal } from 'react-native' | |
import withState from './withState' | |
const ViewUsingModal = ({ isModalVisible, toggleModalVisibility, isLoading }) => | |
<View> | |
<TouchableOpacity onPress={toggleModalVisibility}> | |
<Text>Tap me!</Text> | |
</TouchableOpacity> | |
<Modal visible={isModalVisible}> | |
<View> | |
<Text>I am alive!</Text> | |
</View> | |
</Modal> | |
</View> | |
const withModal = withState('isModalVisibile', 'setModalVisibility', false) | |
const withLoading = withState('isLoading', 'setIsLoading', false) | |
export default withLoading(withModal((ViewUsingModal))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment