react-native-widget-center/example/App.js
2020-07-20 12:24:47 -07:00

55 lines
1.2 KiB
JavaScript

/**
* Sample React Native App
*
* adapted from App.js generated by the following command:
*
* react-native init example
*
* https://github.com/facebook/react-native
*/
import React, {Component} from 'react';
import { NativeModules, Platform, StyleSheet, Text, View} from 'react-native';
import RNWidgetCenter from 'react-native-widget-center';
export default class App extends Component<{}> {
state = {
status: 'starting',
message: '--',
};
componentDidMount() {
RNWidgetCenter.reloadAllTimelines();
}
render() {
return (
<View style={styles.container}>
<Text style={styles.welcome}>RNWidgetCenter example</Text>
<Text style={styles.instructions}>STATUS: {this.state.status}</Text>
<Text style={styles.welcome}>NATIVE CALLBACK MESSAGE</Text>
<Text style={styles.instructions}>{this.state.message}</Text>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
},
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 5,
},
});