React Native – View Component in React Native

In this React Native article we are going to talk about View Component in React Native,

so in React Native we have different built in components that we can use, for example we have

View, Text, Button and many more, in this article we want to talk about React Native View

Component. in react you will use view component a lot more. View Component

in react native is like container, so if you are familiar with the web development, we can say

that it is like div.

 

 

So first we want to create our React Native Project we are going to use Expo Cli.

 

First install expo cli.

 

 

After that create your React Native Project with Expo CLI. you can give the name 

of your project as you want.

 

 

 

 

After creating of the React Native Project, now open your App.js file and create a View

component. make sure that you have imported the View component from React Native.

and add this code in your App.js file.

 

You can see in the above code we have created three View component, also you can give

background color, height, width and padding for a view.

 

 

This is the complete code for App.js.

 

 

 

Now run the code and this will be the result.

React Native - View Component in React Native
React Native

 

Thank you for visiting my website! If you enjoyed the free courses, please consider supporting my works on Patreon.

Leave a Comment