This file contains hidden or 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
import React, { Component } from 'react'; | |
import { Text, View } from 'react-native'; | |
export default class HelloWorldApp extends Component { | |
render() { | |
return ( | |
<View style={{ flex: 1, justifyContent: "center", alignItems: "center" }}> | |
<Text>Hello, world!</Text> | |
</View> | |
); |
This file contains hidden or 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
import React, { Component } from 'react'; | |
import { AppRegistry, Text, View } from 'react-native'; | |
class Blink extends Component { | |
componentDidMount(){ | |
// Toggle the state every second | |
setInterval(() => ( | |
this.setState(previousState => ( | |
{ isShowingText: !previousState.isShowingText } |
This file contains hidden or 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
import React, { Component } from 'react'; | |
import { AppRegistry, StyleSheet, Text, View } from 'react-native'; | |
const styles = StyleSheet.create({ | |
bigBlue: { | |
color: 'blue', | |
fontWeight: 'bold', | |
fontSize: 30, | |
}, | |
red: { |
This file contains hidden or 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
import React, { Component } from 'react'; | |
import { AppRegistry, View } from 'react-native'; | |
export default class FixedDimensionsBasics extends Component { | |
render() { | |
return ( | |
<View> | |
<View style={{width: 50, height: 50, backgroundColor: 'powderblue'}} /> | |
<View style={{width: 100, height: 100, backgroundColor: 'skyblue'}} /> | |
<View style={{width: 150, height: 150, backgroundColor: 'steelblue'}} /> |
This file contains hidden or 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
import React, { Component } from 'react'; | |
import { AppRegistry, Text, TextInput, View } from 'react-native'; | |
export default class PizzaTranslator extends Component { | |
constructor(props) { | |
super(props); | |
this.state = {text: ''}; | |
} | |
render() { |
This file contains hidden or 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
import React, { Component } from 'react'; | |
import { Alert, AppRegistry, Button, StyleSheet, View } from 'react-native'; | |
export default class ButtonBasics extends Component { | |
_onPressButton() { | |
Alert.alert('You tapped the button!') | |
} | |
render() { | |
return ( |
This file contains hidden or 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
import React, { Component } from 'react'; | |
import { AppRegistry, ScrollView, Image, Text } from 'react-native'; | |
export default class IScrolledDownAndWhatHappenedNextShockedMe extends Component { | |
render() { | |
return ( | |
<ScrollView> | |
<Text style={{fontSize:96}}>Scroll me plz</Text> | |
<Image source={{uri: "https://facebook.github.io/react-native/img/favicon.png", width: 64, height: 64}} /> | |
<Image source={{uri: "https://facebook.github.io/react-native/img/favicon.png", width: 64, height: 64}} /> |
This file contains hidden or 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
import React, { Component } from 'react'; | |
import { AppRegistry, FlatList, StyleSheet, Text, View } from 'react-native'; | |
export default class FlatListBasics extends Component { | |
render() { | |
return ( | |
<View style={styles.container}> | |
<FlatList | |
data={[ | |
{key: 'Devin'}, |
This file contains hidden or 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
import React, { Component } from 'react'; | |
import { AppRegistry, SectionList, StyleSheet, Text, View } from 'react-native'; | |
export default class SectionListBasics extends Component { | |
render() { | |
return ( | |
<View style={styles.container}> | |
<SectionList | |
sections={[ | |
{title: 'D', data: ['Devin']}, |