how to create a react native expo app

how to create a react native app

Learn how to create a React Native app with our step-by-step guide, perfect for building high-performance, cross-platform mobile applications quickly and efficiently.


create a expo app

1.install expo cli:

npm install -g expo-cli

2.create a react app:

npx create-expo-app coffeeapp

3.change directory into project folder e.g. coffeeapp


4.start the expo app:

npx expo start

5.reset project:

npm run reset-project

6.open main file[app.tsx]:


import React from 'react';



import {ScrollView, Text ,View} from 'react-native';



export default function Index() {

  return (

    <ScrollView>  



              <View>

                    <Text>welcome</Text>

              </View>



    </ScrollView>

  );

}



how to apply css in a react native app

import React from 'react';

import {StyleSheet,Image, ScrollView, Text ,View} from 'react-native';

export default function Index() {
  return (
    <ScrollView>  

              <View style={styles.flexbox}>
                    <Text style={styles.para}>welcome</Text>
              </View>

    </ScrollView>
  );
}

const styles=StyleSheet.create({
  para:
  {
    fontSize:30,
    color:"green"
  },
  flexbox:
  {
    display:"flex",
    justifyContent:"center",
    alignItems:"center",
    padding:5
  }
})

0 Comments