Getting Started with React Native: Install Node.js, Create Your First App, and Pair with Expo Go

MCL
16 Aug 202408:06

Summary

TLDRIn this tutorial, Sir Marbs introduces React Native, a programming language for creating iOS and Android applications. He guides viewers through downloading Node.js, setting up a React Native environment with Expo CLI, and installing Visual Studio Code for coding. The process includes enabling developer options on a physical device, connecting it for screen mirroring with a laptop, and using the Expo Go app for testing. The video concludes with a basic app setup and instructions on modifying the app's text, encouraging viewers to explore further for in-depth coding knowledge.

Takeaways

  • πŸ’» React Native is a programming language for creating iOS and Android applications.
  • πŸ”— Download Node.js from nodejs.org as a prerequisite for React Native development.
  • πŸ“ Open the command prompt and navigate to a suitable directory for creating the project.
  • πŸš€ Use 'npx create-expo-app' to initialize a new React Native project with a blank template.
  • πŸ“ Name the application during the setup process, e.g., 'my first app'.
  • πŸ”„ Enable Developer Options and USB debugging on the physical device for development.
  • πŸ–₯️ Use Visor to mirror the device screen to the laptop for real-time development feedback.
  • πŸ“± Download the Expo Go app from the Play Store to test and debug the application.
  • πŸ› οΈ Open the project in a text editor like Visual Studio Code for coding and editing.
  • πŸ”§ Run the application using 'npm start' and pair it with the physical device.
  • πŸ” Scan the QR code displayed in the terminal to load the app on the device.
  • ✍️ Edit the app's code in 'app.js' to make changes and save them to see updates in real-time.

Q & A

  • What is React Native?

    -React Native is a framework used for building mobile applications for iOS and Android platforms using JavaScript and React.

  • Why is Node.js necessary for creating a React Native application?

    -Node.js is required because it provides the necessary runtime environment for the JavaScript code that powers React Native applications.

  • What is the purpose of the 'npx create-expo-app' command?

    -The 'npx create-expo-app' command is used to scaffold a new React Native project with a blank template provided by Expo, which simplifies the setup process.

  • What is the role of the Expo Go app?

    -The Expo Go app is used to test and debug React Native applications directly on a physical device by scanning a QR code generated by the development environment.

  • How do you enable Developer Options on an Android device?

    -To enable Developer Options, you need to go to 'Settings', then 'About phone', and tap on 'Build number' several times until the Developer Options are enabled.

  • What does USB debugging allow?

    -USB debugging allows your computer to communicate with your Android device for development purposes, such as deploying and debugging apps.

  • What is Visor and how is it used in the tutorial?

    -Visor is an app that mirrors the screen of your physical device to your laptop monitor, allowing you to see the changes you make in real-time as you develop your app.

  • Why is it necessary to install the Expo Go app from the Play Store?

    -The Expo Go app is necessary to run and test the React Native application on a physical device, as it can scan the QR code generated by the development environment.

  • How do you start a React Native project after setting up the environment?

    -After setting up the environment, you navigate to the project directory in the command prompt or terminal, and run 'npm start' to start the development server.

  • What is the significance of the QR code displayed after running 'npm start'?

    -The QR code is used to pair your physical device with the development environment, allowing you to view and interact with the React Native app on your device.

  • How can you edit the text inside the React Native application?

    -You can edit the text by modifying the 'app.js' file, which contains HTML-like and CSS-like code, and then saving the changes to see them reflected in the app.

Outlines

00:00

πŸ’» Setting Up React Native Development Environment

The video begins with the host, Sir Marbs, introducing React Native, a programming language for creating iOS and Android applications. He instructs viewers to download Node.js from nodejs.org to set up the necessary tools for React Native development. The tutorial then proceeds with instructions to navigate to the command prompt, change directories to 'Documents', and use the command 'npx create-expo-app my first app' to create a new React Native application with a blank template. The host also guides viewers on how to enable Developer Options on their Android device, connect it to the computer for USB debugging, and use a tool called Visor to mirror the device's screen onto the computer. The tutorial concludes with the installation of the Expo Go app from the Play Store for testing and debugging the application.

05:05

πŸ› οΈ Running and Editing a React Native Application

In the second paragraph, the host demonstrates how to run the newly created React Native application using the command 'npm start' in the terminal. After the application starts, a QR code appears, which can be scanned using the Expo Go app to load the application on the device. The host then shows how to open the project in Visual Studio Code and navigate to the 'app.js' file to begin editing the application's code. He explains that the file contains HTML-like and CSS-like code, which will be further elaborated in future tutorials. The host guides viewers to change the text within the application as a simple demonstration of editing the code and saving the changes, which automatically refreshes the application. The video ends with a suggestion for viewers to learn more about coding and setting up React Native applications, and the host thanks the audience for watching.

Mindmap

Keywords

πŸ’‘React Native

React Native is a popular framework developed by Facebook for building mobile applications for iOS and Android platforms using JavaScript and React. It allows developers to use a single codebase for both platforms, which can significantly reduce development time and cost. In the script, React Native is introduced as the main subject, with the tutorial focusing on setting up the environment and creating a basic application using this technology.

πŸ’‘Node.js

Node.js is a runtime environment that allows developers to execute JavaScript on the server side. It's built on Chrome's V8 JavaScript engine and is used extensively in web development for creating scalable network applications. In the context of the video, Node.js is a prerequisite for setting up the React Native development environment, as it includes the package manager npm which is used to install various development tools and libraries.

πŸ’‘npm

npm stands for Node Package Manager, which is a default package manager for the JavaScript runtime environment Node.js. It is used to manage project dependencies and to distribute JavaScript code. In the script, npm is used to install the necessary tools and dependencies for creating a React Native application, such as by running 'npm install' to set up the project.

πŸ’‘Expo

Expo is a set of tools and services built around React Native that helps developers create, build, and ship mobile apps. It provides a managed platform that includes a development tool, a build system, and a publishing platform. In the video, Expo CLI is used to quickly set up a new React Native project with a 'blank' template, which provides a starting point for development.

πŸ’‘Command Prompt

The command prompt, also known as command line interface (CLI), is a text-based user interface where users can interact with the operating system by typing commands. In the script, the command prompt is used to navigate directories, execute commands to set up the development environment, and to initiate the creation of a new React Native application.

πŸ’‘USB Debugging

USB debugging is a feature in Android that allows a computer to communicate with an Android device via a USB connection for debugging purposes. It is essential for developing and testing Android applications. In the video, enabling USB debugging on a physical device is a step required to connect the device to a computer for real-time testing and debugging of the React Native application.

πŸ’‘VS Code

VS Code, or Visual Studio Code, is a free, open-source source code editor developed by Microsoft. It supports a wide array of programming languages and provides features like code completion, debugging, and version control. In the script, VS Code is used as the text editor to write and edit the code for the React Native application.

πŸ’‘App.js

App.js is a common entry point file for React Native applications, where the main UI components and logic are defined. It serves as the root component of the application and is where developers start building the user interface. In the video, editing App.js is mentioned as a step to customize the application, indicating its importance in the development process.

πŸ’‘QR Code

A QR code is a type of barcode that can be scanned by smartphones to quickly access information. In the context of the video, a QR code is generated by the development tools to facilitate the connection between the physical device and the development environment, allowing developers to view and interact with the app on their device in real-time.

πŸ’‘Expo Go

Expo Go is an app available on the iOS App Store and Google Play Store that allows users to view and interact with Expo-managed React Native projects without the need to build a standalone app. In the video, Expo Go is used to scan a QR code and run the React Native application on a physical device, streamlining the testing and debugging process.

Highlights

Introduction to React Native as a programming language for creating iOS and Android applications.

Necessity to download Node.js from nodejs.org for React Native development.

Instructions to change directory to a suitable folder like Documents for project setup.

Creating a React Native application using npx create-expo-app with a blank template.

Naming the app 'my first app' during the setup process.

Downloading and using Visor to reflect the physical device screen to the laptop monitor.

Enabling Developer options and USB debugging on the physical device.

Connecting the device to the computer for screen mirroring with Visor.

Installing Expo Go from the Play Store for testing and debugging the application.

Running the project using npm start and pairing it with the physical device.

Scanning the QR code to load the application on the Expo Go app.

Editing the app.js file to work on the application's code.

Explanation of the HTML-like and CSS-like code structure in app.js.

Demonstration of how to edit the text within the application and save changes.

Observation of the application automatically refreshing after code changes.

Encouragement for viewers to learn more about coding and setting up the application.

Conclusion of the tutorial with a thank you note to the viewers.

Transcripts

play00:00

hi guys it's me sir marbs so today I

play00:03

will uh introduce this uh react native

play00:07

um it's a programming language that can

play00:11

uh help you to create an IOS and Android

play00:17

application

play00:19

so first thing you need to do is uh you

play00:22

need to download uh the necessary tool

play00:26

in order for you to create a re

play00:30

native application so you need to

play00:33

download this

play00:34

nodejs go to this uh website nodejs.org

play00:38

and then download this under the

play00:41

pre-build installer and then install it

play00:44

so to pass spacee this uh

play00:47

tutorial um let's get started first

play00:50

thing that you need to do is you go to

play00:53

your command prompt go to your command

play00:56

prompt and in your command prompt as you

play00:58

can see here

play01:01

we are now in the uh user directory so

play01:05

let's change our directory by going to

play01:09

different folder like documents CD

play01:13

documents and then here I can now uh

play01:17

create

play01:18

our react native application so to

play01:22

create

play01:23

that let's uh put

play01:26

npx

play01:28

create X

play01:31

Expo

play01:33

app and then template

play01:39

blank uh give us a fresh

play01:42

start uh we

play01:45

install our application to have a

play01:48

template uh blank okay so let's hit

play01:54

enter now the next step here is you need

play01:57

to put the name of your app so we'll

play02:00

call

play02:01

this

play02:03

my first

play02:07

app

play02:08

okay then

play02:11

enter so while waiting you can download

play02:15

visor so we will use visor in this

play02:18

tutorial so that we can reflect our

play02:20

physical device screen to our uh laptop

play02:25

monitor to do that we will need to open

play02:29

our device our physical device and go to

play02:32

build number and enable the U developers

play02:37

option so after doing that we will now

play02:41

connect our device through the cable and

play02:44

once your cell phone is um detected it

play02:49

or it will prompt in your device the

play02:53

allow USB debugging let's allow USB

play02:56

debugging and as you can see devisor uh

play03:00

uh or our application is already

play03:02

connected to this visor let's now play

play03:06

this so that you will see

play03:08

here our screen physical screen of our

play03:17

device yes as you can see you have now

play03:23

already um displayed our physical device

play03:28

screen so you need to install first the

play03:34

Expo go so kindly go to

play03:37

your uh Play Store you will download

play03:40

this Expo Go app we will use this so

play03:43

that we can test and debug our

play03:48

application so let's go back now to our

play03:52

Command promp so as you can see here

play03:55

that our project is ready as you can see

play03:58

it's already installed now to run our

play04:01

project you need to go first to our uh

play04:05

directory file so if you're still

play04:08

remember uh the name of our application

play04:11

is my first app so let's go to my first

play04:21

app this one so let's uh hit

play04:25

enter now after locating our directory

play04:28

file we will open this in our text

play04:33

editor so in this case I will use vs

play04:37

code to do that I can state code here

play04:40

space and Dot and then

play04:46

enter then

play04:48

automatically the vs code will load

play04:52

our directory

play04:54

file so as you can see here we have our

play04:58

the name of our application my first

play05:05

app okay now inside this um vs code we

play05:10

can go to the terminal here the upper

play05:15

left corner so we can click terminal and

play05:19

then new

play05:21

terminal inside this new terminal we can

play05:23

now start our or we can now run our

play05:27

application

play05:30

and pair it to

play05:32

our physical

play05:34

device so let's do that npm

play05:44

start so after loading or after starting

play05:48

our application you will see

play05:51

this QR

play05:54

code and using this

play05:56

application in our

play06:01

application so we can now scan this QR

play06:05

code so let's click scan

play06:10

QR and then scan the QR

play06:14

code and automatically our application

play06:17

will load

play06:21

here so

play06:23

after running our application you will

play06:26

see this in your this display so open up

play06:32

app.js to start working on your app so

play06:35

congratulation you are now uh already

play06:38

installed an

play06:39

application to your physical device so

play06:43

in order for us to change the text

play06:45

inside

play06:47

this we can go to app.js as stated here

play06:51

so double click the

play06:53

appjs this will be our

play07:01

code and inside this you can see

play07:05

um an an HTML like code and a CSS like

play07:12

code so later I will explain to you on

play07:15

how to use this so for now let's try to

play07:20

edit the text inside our

play07:23

application so let's try congrats

play07:31

and then contrl s to save and as you can

play07:35

see

play07:37

automatically your

play07:39

application it's being refreshed so

play07:43

congratulation you are

play07:45

now have your

play07:48

application I suggest if you want to

play07:52

really know how to code or how to set up

play07:56

this application I will end now the

play07:59

video and you may try it thank you for

play08:03

watching

Rate This
β˜…
β˜…
β˜…
β˜…
β˜…

5.0 / 5 (0 votes)

Related Tags
React NativeMobile AppsProgrammingNodeJSExpoApp DevelopmentTutorialiOSAndroidCode EditorLive Preview