Skip to content

Instantly share code, notes, and snippets.

@andrepimenta
Last active July 25, 2019 21:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrepimenta/c566cfefceb507c8017483806c034213 to your computer and use it in GitHub Desktop.
Save andrepimenta/c566cfefceb507c8017483806c034213 to your computer and use it in GitHub Desktop.
Tutorial file for React Native Bridge javascript side
/**
* 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