Hello World — React native

What is React Native?

Let’s Start

npm install -g expo-cli
expo init helloWorld
template
cd helloWorld
npm start
Terminal
Expo dev tools running on browser

How to Run on Actual Device

Hello world App

export default class App extends React.Component {   constructor(props){     super(props);     this.state = {     name: 'World!',     }   }   onClick = () => {     this.setState({     name: 'John!',     })   };   render() {   return (     <View style={styles.container}>       <Text>Hello {this.state.name}</Text>       <Button 
onPress={() => {this.onClick()}}
title='Click me'
color='#4169E1'>
</Button>
</View> ); }}const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: '#fff', alignItems: 'center', justifyContent: 'center', }, nameText: { fontSize: 50, padding: 15, }});

--

--

Doctoral researcher

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store