microsoft/vscode-react-native

Public

mirrored fromhttps://github.com/microsoft/vscode-react-nativeAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
c8ff508e5391b3583d7ab78a4ad2b6c66fffa16b

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

SampleApplication/index.ios.js

59lines · modecode

1/**
2 * Sample React Native App
3 * https://github.com/facebook/react-native
4 */
5'use strict';
6import React, {
7 AppRegistry,
8 Component,
9 StyleSheet,
10 Text,
11 View,
12 TouchableHighlight
13} from 'react-native';
14
15class SampleApplication extends Component {
16 showMessage () {
17 alert("You pressed a button");
18 }
19 render() {
20 return (
21 <View style={styles.container}>
22 <Text style={styles.welcome}>
23 Welcome to React Native!
24 </Text>
25 <Text style={styles.instructions}>
26 To get started, edit index.ios.js
27 </Text>
28 <Text style={styles.instructions}>
29 Press Cmd+R to reload,{'\n'}
30 Cmd+D or shake for dev menu
31 </Text>
32 <TouchableHighlight onPress={() => this.showMessage()}>
33 <Text>Toggle</Text>
34 </TouchableHighlight>
35 </View>
36 );
37 }
38}
39
40const styles = StyleSheet.create({
41 container: {
42 flex: 1,
43 justifyContent: 'center',
44 alignItems: 'center',
45 backgroundColor: '#F5FCFF',
46 },
47 welcome: {
48 fontSize: 20,
49 textAlign: 'center',
50 margin: 10,
51 },
52 instructions: {
53 textAlign: 'center',
54 color: '#333333',
55 marginBottom: 5,
56 },
57});
58
59AppRegistry.registerComponent('SampleApplication', () => SampleApplication);
60