/** * Sample React Native App * https://github.com/facebook/react-native * @flow */ import React, { Component } from 'react'; import { AppRegistry, StyleSheet, Text, View, TouchableOpacity } from 'react-native'; class example extends Component { constructor(props) { super(props); this.state = { greeting: undefined }; } render() { if (this.state.greeting) return this.renderAfterButton(); return ( Welcome Say Hello Say World ); } renderAfterButton() { return ( {this.state.greeting}!!! ); } onButtonPress(greeting) { this.setState({ greeting: greeting }); } } AppRegistry.registerComponent('example', () => example);