CIT-5104-Lesson-4-REACTIVE NATIVE
CIT-5104-Lesson-4-REACTIVE NATIVE
BUIDLING MOBILE
APPS WITH
REACT NATIVE
04/21/25 1
Lesson 4
PART 1
04/21/25 2
What is REACT NATIVE?
• React Native is an open source framework for building
native Android and iOS applications using React and the
app platform’s native capabilities.
04/21/25 3
What is REACT
• React, sometimes referred to as a
frontend JavaScript framework, is a
JavaScript library created by Facebook
and used for building UI components.
04/21/25 4
REACT-DOM vs REACT-NATIVE
• REACT uses REACT-DOM, while REACT
NATIVE uses REACT-NATIVE libraries
• React DOM uses HTML, CSS, and
JavaScript for layout and styling of Web
Apps.
04/21/25 6
PRE-REQUISITES
• JavaScript:(https://www.w3schools.com/js/
default.asp)
• REACT
fundamentals(https://www.w3schools.com/R
EACT/DEFAULT.ASP)
04/21/25 7
WHAT IS EXPO?
• Expo is a set of tools and services built around
React Native apps with consolidated logic for
both iOS and Android..
04/21/25 8
ADVANTAGES of Expo vs REACT-NATIVE CLI
• Access to Pre-built Libraries: provides a wide range of pre-
built libraries and APIs.
• Simplified Build Process: handles the build process for you,
abstracting away the need to configure build tools and deal with
native code compilation.
• Native Physical Device: you can have the Expo Go app
installed in your mobile and connect over the same network and
get your app tested on any physical device [both Android and
iOS].
• No need for a mac to build an iOS App. Code can be built and
deployed to the cloud. From there you can directly deploy it to
the store.
Disadvantage:
• Limited Native Modules: Expo restricts access to certain native
modules, which means you may encounter limitations when
trying to integrate certain third-party libraries or accessing low-
level device features.
04/21/25 9
PART TWO
PROJECT
STRUCTURE
04/21/25 10
INTRODUCTION
04/21/25 12
App.js
• The App.js file is the default screen
of your project.
• It is the root file that you'll load after
running the development server
with npx expo start.
• You can edit this file to see the
project update instantly.
• Generally, this file will contain root-
level React Contexts and navigation.
04/21/25 13
app.json
• The app.json file contains
configuration options for the
project.
04/21/25 14
Assets folder
• The assets folder contains adaptive-icon.png
used for Android and an icon.png used for iOS
as an app icon.
04/21/25 15
Components folder
• The components directory is where you should
put all your reusable components.
04/21/25 16
Other standard files
• The standard files listed below are
part of every project created with
Expo CLI.
• You can edit them to customize your
project.
04/21/25 17
.gitignore
• A .gitignore allows you to list files
and folders that you don't want to
be tracked by Git.
• You can modify the files to list other
files and folders in your project.
04/21/25 18
babel.config.js
• Applies the babel-preset-expo preset that
extends the default React Native preset
and adds support for decorators, tree-
shaking web packages, and loading font
icons with optional native dependencies if
they're installed.
04/21/25 19
package.json
• The package.json file contains the project's
dependencies, scripts and metadata.
• Anytime a new dependency is added to your
project, it will be added to this file.
04/21/25 20
Devices For Running
Expo App(Mobile App)
1.IOS Device
2.Android Device(using expo)
3.IOS simulator
4.Android Emulator
04/21/25 21
END OF PART
TWO
THANK YOU
04/21/25 22
PART 3
SETTING UP THE
DEVELOPMENT
ENVIRONMENT
04/21/25 23
SETTING UP THE DEVELOPMENT
ENVIRONMENT
1.Install Node.js on your computer
2.Install Vs Code
3.Install Expo Go on your smartphone from
Google Play store
4.Create your project Folder called React-Native
on your Desktop
5.Open the folder in VsCode
6.Install REACT NATIVE using Expo as follows
04/21/25 24
Installing Steps: React Native
• Run the following command to create a new React
Native project called “bmcsApp":
04/21/25 25
Incase of errors, set default
`CONNECTION` to `tunnel` as
shown
04/21/25 26
Connection Gives error on 1st
attempt but connects on 2nd
Attempt
04/21/25 27
END OF PART 3
THANK YOU
04/21/25 28
PART 4
DEVELOPMENT
WITH REACT
NATIVE
COMPONENTS
04/21/25 29
INTRODUCTION
• Components are independent and reusable bits
of code.
• They serve the same purpose as JavaScript
functions, but work in isolation and return HTML.
• Two types, Class components and Function
components,
04/21/25 30
CLASS COMPONENT
• A class component must include the extends
React.Component statement.
• This statement creates an inheritance to
React.Component, and gives your component access to
React.Component's functions.
• The component also requires a render() method, this
method returns HTML.
04/21/25 31
FUNCTION COMPONENT
• Here is the same example as above, but created using a
Function component instead.
• A Function component also returns HTML, and behaves
much the same way as a Class component, but Function
components can be written using much less code.
• function Car() {
• return <h2>Hi, I am a Car!</h2>;
• }
04/21/25 32
REACT NATIVE COMPONENTS
• React uses the virtual DOM (Document
Object Model) to render code in a web
browser.
• React Native uses native APIs to
render UIs on mobile devices.
• In Android development, you write views
in Kotlin or Java;
• in iOS development, you use Swift or
Objective-C.
04/21/25 33
REACT NATIVE
COMPONENTS(cont.)
• With React Native, you can invoke these
views with JavaScript using React
components.
04/21/25 34
REACT NATIVE
COMPONENTS(cont.)
• Because React Native components are
backed by the same views as Android and
iOS, React Native apps look, feel, and
perform like any other apps.
04/21/25 35
THE CORE COMPONENTS
REACT NATIVE UI
ANDROID VIEW IOS VIEW WEB ANALOG DESCRIPTION
COMPONENT
A container that
A non- supports layout with
<View> <ViewGroup> <UIView> scrolling <div flexbox, style, some
touch handling, and
> accessibility controls
04/21/25 37
Creating a Blank Project
• npx create-expo-app@latest CoreComponents --
template blank@sdk-49
04/21/25 38
Starting the Project
• npx npm start
04/21/25 39
Mobile Screen on Expo
04/21/25 40
Mobile Screen on Expo(cont.)
04/21/25 41
Viewing Options
• Click w to open on web view
04/21/25 42
After Pressing w for web view
• It looks like you're trying to use web support
but don't have the required dependencies
installed.
04/21/25 43
Installing web pack
04/21/25 44
App showing in Web Browser
04/21/25 45
VIEWS AND VIEW NESTING
• Delete everting in app.js and Create this Code in app.js
</View>
</View>
</View>
);
}
04/21/25 46
VIEWS AND VIEW NESTING(cont.)
• Output on web Pack
04/21/25 47
TEXT
• A React component for displaying
text.
• Text supports nesting, styling,
and touch handling.
• Depending on the target platform,
React-Native will translate this
component to either a UI
TextView(iOS), a
TextView(android) or a ‘p’ (web)
04/21/25 48
CREATING TEXT
• Import a Text View and Wrap Text in Text
Component
);
04/21/25 49
}
TEXT OUTPUT ON WEB
• Text positioning not proper
04/21/25 50
TEXT PADDING OF 100
Adding a Padding in the View
);
}
04/21/25 51
TEXT OUTPUT ON WEB
• Text positioning with a padding of 100
improves
04/21/25 52
TEXT FORMATTING
Adding a Padding in the View
import {View, Text } from 'react-native'
export default function App(){
return (
<View style = {{ flex:1,
backgroundColor:"red", padding:100}}>
<Text>
<Text style = {{ fontSize:30, color:
'white' }}>Hello</Text> MSC IT TUM
</Text>
</View>
);
}
04/21/25 53
TEXT FORMATTING OUTPUT
• Text Formatting
04/21/25 54
IMAGE
• A React component for displaying
different types of images, including
network images, static resources,
temporary local images, and images from
local disk, such as the camera roll.
04/21/25 55
THE END
Thank you!
04/21/25 56