1
0
Code Issues Pull Requests Packages Projects Releases Wiki Activity GitHub Gitee
react-native-wechat/example/App.js

56 lines
1.2 KiB
JavaScript
Raw Normal View History

2020-07-31 14:47:29 +08:00
/**
* 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';
2020-08-01 18:05:40 +08:00
import { Platform, SafeAreaView, StyleSheet, Text, View } from 'react-native';
2020-07-31 14:47:29 +08:00
import RNWechat from '@uiw/react-native-wechat';
2020-08-01 18:05:40 +08:00
export default class App extends Component {
2020-07-31 14:47:29 +08:00
state = {
message: '--'
};
componentDidMount() {
2020-08-01 18:05:40 +08:00
// RNWechat.sampleMethod('Testing', 123, (message) => {
// this.setState({
// message
// });
// });
2020-07-31 14:47:29 +08:00
}
render() {
return (
2020-08-01 18:05:40 +08:00
<SafeAreaView style={{ flex: 1 }}>
<View style={styles.container}>
<Text style={styles.welcome}>Wechat Example</Text>
<Text style={styles.instructions}>{this.state.message}</Text>
</View>
</SafeAreaView>
2020-07-31 14:47:29 +08:00
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
2020-08-01 18:05:40 +08:00
// justifyContent: 'center',
2020-07-31 14:47:29 +08:00
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
},
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 5,
},
});