Last active
July 25, 2019 21:34
-
-
Save andrepimenta/c566cfefceb507c8017483806c034213 to your computer and use it in GitHub Desktop.
Tutorial file for React Native Bridge javascript side
This file contains 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
/** | |
* Sample React Native App | |
* https://github.com/facebook/react-native | |
* | |
* @format | |
* @flow | |
*/ | |
import React, {Component} from 'react'; | |
import { | |
View, | |
StyleSheet | |
} from 'react-native'; | |
import { NativeModules } from 'react-native'; | |
class App extends Component { | |
componentDidMount(){ | |
var LoadingOverlay = NativeModules.LoadingOverlay; | |
//Let's show it | |
LoadingOverlay.toggle(true) | |
// And let's hide it after 3 seconds | |
setTimeout(()=>{ | |
LoadingOverlay.toggle(false) | |
}, 3000) | |
} | |
render(){ | |
return ( <View style={styles.background}></View>) | |
} | |
}; | |
const styles = StyleSheet.create({ | |
background: { | |
backgroundColor: '#6ce6cb', | |
flex: 1, | |
}, | |
}); | |
export default App |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment