Image for post
Image for post

What is React Native?

Let’s Start

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

How to Run on Actual Device

Image for post
Image for post

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, }});
Image for post
Image for post

Software Engineer

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