React Native
About Lesson

In this React Native lesson we are going to learn about React Native Functional Component, so components are the building blocks of a React Native application, for example you have an application, and you have screens like login screen, registration screen and profile screen, now you can create separate components for these screens, you can create as many as components you want, also there are two types of components that you can use. we have functional component and class component.

 

 

 

So now let’s create our first functional component, functional components are basically JavaScript functions, you can use arrow function or you can regular JavaScript function.

 

In here i want to create a new functional component at name of Hello.js.

 

You can see that at the top we have some imports, after that we have created our arrow function, and in the function we need to return something, for example in here we want to return some texts, For creating Text in react native you can use Text built in component, you can see that we have wrapped our Text in a View, so View is a built in component in React Native that acts as a container, at the end you need to just export your component.

 

 

 

 

Now we can add our component in our App.js file, so App.js is the entry point of React Native application.

 

First you need to import the component in your App.js file.

 

 

And after that you can add.

 

 

 

 

Run your application and this will be the result.

React Native Functional Component
React Native Functional Component

 

 

 

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