React Native

What is React Native?
What is React Native?
Why React Native?
What is React Native?
Why React Native?
Prerequisites
What is React Native?
What is React Native?
React Native is a framework that helps developers make Android and iOS apps using React, and since it’s open-source, it’s available for everyone.
What is React Native?
React Native is a framework that helps developers make Android and iOS apps using React, and since it’s open-source, it’s available for everyone.
JavaScript can be used to control device features like the camera and push notifications
In mobile apps.
What is React Native?
React Native is a framework that helps developers make Android and iOS apps using React, and since it’s open-source, it’s available for everyone.
JavaScript can be used to control device features like the camera and push notifications
In mobile apps.
With React components, you can build and manage your app's visual style and interactions.
What is React Native?
React Native is a framework that helps developers make Android and iOS apps using React, and since it’s open-source, it’s available for everyone.
JavaScript can be used to control device features like the camera and push notifications
In mobile apps.
With React components, you can build and manage your app's visual style and interactions.
React is a tool that helps developers create what users see and interact with on
websites and apps.
What is React Native?
React Native is a framework that helps developers make Android and iOS apps using React, and since it’s open-source, it’s available for everyone.
JavaScript can be used to control device features like the camera and push notifications
In mobile apps.
With React components, you can build and manage your app's visual style and interactions.
React is a tool that helps developers create what users see and interact with on
websites and apps.
react-dom helps build web applications, while react-native creates mobile apps for
iOS and Android.
Why React Native ?
Why React Native ?
To make iPhone apps, developers need to use either Swift or Objective-C
programming languages.
Why React Native ?
To make iPhone apps, developers need to use either Swift or Objective-C
programming languages.
Since about 28% of users are on iPhones and 72% on Android phones, you'd normally have to build two different apps - one using Apple's tools (like Swift) and one using
Google's tools (like Kotlin).
Why React Native ?
To make iPhone apps, developers need to use either Swift or Objective-C
programming languages.
Since about 28% of users are on iPhones and 72% on Android phones, you'd normally have to build two different apps - one using Apple's tools (like Swift) and one using
Google's tools (like Kotlin).
React Native is one of the most sought-after skills in mobile development right now, with many companies hiring specialists in this area.
Why React Native ?
To make iPhone apps, developers need to use either Swift or Objective-C
programming languages.
Since about 28% of users are on iPhones and 72% on Android phones, you'd normally have to build two different apps - one using Apple's tools (like Swift) and one using
Google's tools (like Kotlin).
React Native is one of the most sought-after skills in mobile development right now, with many companies hiring specialists in this area.
Instead of hiring different teams for iOS and Android apps, companies can choose one team that knows React Native. This helps save both time and money.
Why React Native ?
To make iPhone apps, developers need to use either Swift or Objective-C
programming languages.
Since about 28% of users are on iPhones and 72% on Android phones, you'd normally have to build two different apps - one using Apple's tools (like Swift) and one using
Google's tools (like Kotlin).
React Native is one of the most sought-after skills in mobile development right now, with many companies hiring specialists in this area.
Instead of hiring different teams for iOS and Android apps, companies can choose one team that knows React Native. This helps save both time and money.
A team that knows React can work on both mobile apps using React Native and websites using React, which makes them more flexible.
Why React Native ?
To make iPhone apps, developers need to use either Swift or Objective-C
programming languages.
Since about 28% of users are on iPhones and 72% on Android phones, you'd normally have to build two different apps - one using Apple's tools (like Swift) and one using
Google's tools (like Kotlin).
React Native is one of the most sought-after skills in mobile development right now, with many companies hiring specialists in this area.
Instead of hiring different teams for iOS and Android apps, companies can choose one team that knows React Native. This helps save both time and money.
A team that knows React can work on both mobile apps using React Native and websites using React, which makes them more flexible.
Companies like Microsoft, Meta, Tesla, Pinterest, Discord
Prerequisites
Prerequisites
JavaScript
Prerequisites
JavaScript
React fundamentals
Expo vs React Native
Expo vs React Native
React Native is a free tool created by Facebook (now Meta) that lets developers build apps for both iPhones and Androids using the same code.
Expo vs React Native
React Native is a free tool created by Facebook (now Meta) that lets developers build apps for both iPhones and Androids using the same code.
Expo is an open-source framework maintained by Expo itself, designed for building
cross-platform apps
Expo vs React Native
React Native is a free tool created by Facebook (now Meta) that lets developers build apps for both iPhones and Androids using the same code.
Expo is an open-source framework maintained by Expo itself, designed for building
cross-platform apps
Setting up a React Native project takes time and effort. Expo simplifies this with ready-to-use tools, saving you hours of work.
Expo vs React Native
React Native is a free tool created by Facebook (now Meta) that lets developers build apps for both iPhones and Androids using the same code.
Expo is an open-source framework maintained by Expo itself, designed for building
cross-platform apps
Setting up a React Native project takes time and effort. Expo simplifies this with ready-to-use tools, saving you hours of work.
Unlike plain React Native, Expo includes helpful tools and services that take care of complicated parts, so you can focus on building your app.
Expo vs React Native
React Native is a free tool created by Facebook (now Meta) that lets developers build apps for both iPhones and Androids using the same code.
Expo is an open-source framework maintained by Expo itself, designed for building
cross-platform apps
Setting up a React Native project takes time and effort. Expo simplifies this with ready-to-use tools, saving you hours of work.
Unlike plain React Native, Expo includes helpful tools and services that take care of complicated parts, so you can focus on building your app.
Building iOS apps with standard React Native requires macOS - it won't work on Windows or Linux systems. This is an Apple requirement.
Expo vs React Native
React Native is a free tool created by Facebook (now Meta) that lets developers build apps for both iPhones and Androids using the same code.
Expo is an open-source framework maintained by Expo itself, designed for building
cross-platform apps
Setting up a React Native project takes time and effort. Expo simplifies this with ready-to-use tools, saving you hours of work.
Unlike plain React Native, Expo includes helpful tools and services that take care of complicated parts, so you can focus on building your app.
Building iOS apps with standard React Native requires macOS - it won't work on Windows or Linux systems. This is an Apple requirement.
The great thing about Expo is that you don't need a Mac to test on iPhones - you can develop on Windows/Linux and still run your app on physical iOS devices.
Expo
Expo
Over the years, Expo has grown much more powerful - today it supports most features required for complete app development.
Expo
Over the years, Expo has grown much more powerful - today it supports most features required for complete app development.
When you need native device features that Expo doesn't cover, you can switch your app to standard React Native to get full code access.
Core Components
Core Components
React Native comes with ready-to-use building blocks called Core Components. These help you quickly create your app's interface without building everything from scratch.
Core Components
React Native comes with ready-to-use building blocks called Core Components. These help you quickly create your app's interface without building everything from scratch.
| React Native UI Component | Android View | IOS View | Web View |
|---|---|---|---|
| <View> | <ViewGroup> | <UIView> | A non-scrolling <div> |
| <Text> | <TextView> | <UITextView> | <p> |
| <Image> | <ImageView> | <UIImageView> | <img> |
| <ScrollView> | <ScrollView> | <UIScrollView> | <div> |
| <TextInput> | <EditText> | <UITextField> | <input type="text"> |
View <View>
View <View>
The View component is like a container that helps you organize and structure your app's layout. It's one of the most basic and important building blocks in React Native.
View <View>
The View component is like a container that helps you organize and structure your app's layout. It's one of the most basic and important building blocks in React Native.
This works as a box that holds other parts of the app. It lets you control layout with Flexbox, add styles, respond to touches, and support accessibility.
View <View>
The View component is like a container that helps you organize and structure your app's layout. It's one of the most basic and important building blocks in React Native.
This works as a box that holds other parts of the app. It lets you control layout with Flexbox, add styles, respond to touches, and support accessibility.
You can think of the View component in React Native as similar to a <div> in HTML. Both are used to build and organise parts of the page or screen.
Text <Text>
Text <Text>
The Text the component is used to show words or sentences on the screen, like a paragraph or heading in a web page
Text <Text>
The Text the component is used to show words or sentences on the screen, like a paragraph or heading in a web page
Depending on the platform, React Native turns the Text component into the right native
element — like UITextView for iOS, TextView for Android, or a <p> tag for web.
Image <Image>
Image <Image>
With the Image component, you can display images in your app — whether they’re stored online or included in the app itself.
Image <Image>
With the Image component, you can display images in your app — whether they’re stored online or included in the app itself.
- Static Images
- Network Images
- Images from the local disk, such as the camera roll
Image <Image>
With the Image component, you can display images in your app — whether they’re stored online or included in the app itself.
The Image component in React Native is smart — it changes into the correct image type depending on whether the app is running on iOS, Android, or the web.
- Static Images
- Network Images
- Images from the local disk, such as the camera roll
Image <Image>
With the Image component, you can display images in your app — whether they’re stored online or included in the app itself.
The Image component in React Native is smart — it changes into the correct image type depending on whether the app is running on iOS, Android, or the web.
- UIImageView for iOS
- ImageView for Android
- 'img' for the Web
- Static Images
- Network Images
- Images from the local disk, such as the camera roll
ScrollView <ScrollView/>
ScrollView <ScrollView/>
The ScrollView component provides a scrollable container for your content, handling all the scrolling behavior automatically across both iOS and Android.
ScrollView <ScrollView/>
The ScrollView component provides a scrollable container for your content, handling all the scrolling behavior automatically across both iOS and Android.
ScrollView needs a fixed height limit to work correctly - without it, the scrolling won't
behave as expected.
Pressable <Pressable/>
Pressable <Pressable/>
Pressable is a component that wraps around other elements and can sense different steps of a press, like when it starts or ends.
Pressable <Pressable/>
Pressable is a component that wraps around other elements and can sense different steps of a press, like when it starts or ends.
You can make your own button by wrapping it with the Pressable component.
Pressable <Pressable/>
Pressable is a component that wraps around other elements and can sense different steps of a press, like when it starts or ends.
You can make your own button by wrapping it with the Pressable component.
- The onPressIn function runs as soon as the user starts pressing the component.
Pressable <Pressable/>
Pressable is a component that wraps around other elements and can sense different steps of a press, like when it starts or ends.
You can make your own button by wrapping it with the Pressable component.
- The onPressIn function runs as soon as the user starts pressing the component.
- The onLongPress function runs when the user keeps pressing on the component for more
than half a second.
Pressable <Pressable/>
Pressable is a component that wraps around other elements and can sense different steps of a press, like when it starts or ends.
You can make your own button by wrapping it with the Pressable component.
- onPressOut event is triggered when the user releases their press or touch from
the component.
- The onPressIn function runs as soon as the user starts pressing the component.
- The onLongPress function runs when the user keeps pressing on the component for more
than half a second.
Pressable <Pressable/>
Modal <Modal/>
Modal <Modal/>
A Modal is a screen that appears on top of the app to show important information or ask the user to make a choice.
Modal <Modal/>
A Modal is a screen that appears on top of the app to show important information or ask the user to make a choice.
Because modals can interrupt the user experience, you should only use them when
absolutely needed.
StatusBar <StatusBar/>
StatusBar <StatusBar/>
You can use the StatusBar in React Native to control the appearance of the top bar on
your phone screen.
StatusBar <StatusBar/>
You can use the StatusBar in React Native to control the appearance of the top bar on
your phone screen.
The status bar is the area at the top of the screen that shows the time, Wi-Fi signal, battery level, and other small icons.
ActivityIndicator <ActivityIndicator/>
ActivityIndicator <ActivityIndicator/>
The ActivityIndicator shows a spinning circle to let users know something is loading.
ActivityIndicator <ActivityIndicator/>
The ActivityIndicator shows a spinning circle to let users know something is loading.
It is used to show the user that something is happening, like loading the app, submitting a form, or saving changes.
Alert <Alert/>
Alert <Alert/>
The Alert shows a pop-up box with a title and message you choose.
Alert <Alert/>
The Alert shows a pop-up box with a title and message you choose.
If needed, you can add some buttons in the alert for user actions.
Core Components
View
Pressable
Text
Modal
Image
StatusBar
ScrollView
ActivityIndicator
Button
Alert
Styling React Native Apps
Styling React Native Apps
React Native doesn’t use regular CSS to style components.
Styling React Native Apps
React Native doesn’t use regular CSS to style components.
In React Native, you use JavaScript to style your app instead of CSS.
Styling React Native Apps
React Native doesn’t use regular CSS to style components.
In React Native, you use JavaScript to style your app instead of CSS.
Style names in React Native are written in camelCase, like backgroundColor
Styling React Native Apps
React Native doesn’t use regular CSS to style components.
In React Native, you use JavaScript to style your app instead of CSS.
Style names in React Native are written in camelCase, like backgroundColor
Style names in React Native are written in camelCase, like backgroundColor
insted of background-color
Platform-specfic Code
When building apps for both iOS and Android, the main goal is to write most of your code once and use it for both platforms.
Platform-specfic Code
When building apps for both iOS and Android, the main goal is to write most of your code once and use it for both platforms.
Sometimes you'll need to write different code for iOS and Android when your app requires platform-specific features.
Platform-specfic Code
When building apps for both iOS and Android, the main goal is to write most of your code once and use it for both platforms.
Sometimes you'll need to write different code for iOS and Android when your app requires platform-specific features.
Each platform has its own little differences:
Platform-specfic Code
When building apps for both iOS and Android, the main goal is to write most of your code once and use it for both platforms.
Sometimes you'll need to write different code for iOS and Android when your app requires platform-specific features.
Each platform has its own little differences:
- iOS loves its sleek navigation stacks
Platform-specfic Code
When building apps for both iOS and Android, the main goal is to write most of your code once and use it for both platforms.
Sometimes you'll need to write different code for iOS and Android when your app requires platform-specific features.
Each platform has its own little differences:
- iOS loves its sleek navigation stacks
- Android has a material design style
Platform-specfic Code
When building apps for both iOS and Android, the main goal is to write most of your code once and use it for both platforms.
Sometimes you'll need to write different code for iOS and Android when your app requires platform-specific features.
Each platform has its own little differences:
- iOS loves its sleek navigation stacks
- Android has a material design style
- The web focuses on custom layouts and URLs
Platform-specfic Code
When building apps for both iOS and Android, the main goal is to write most of your code once and use it for both platforms.
Sometimes you'll need to write different code for iOS and Android when your app requires platform-specific features.
Each platform has its own little differences:
- iOS loves its sleek navigation stacks
- Android has a material design style
- The web focuses on custom layouts and URLs
Platform-specific code lets you adjust your app’s behaviour or design for each platform, while keeping the same code structure
Platform-specfic Code
FlatList
FlatList
FlatList is smart - it only shows the list items you can see on screen, which saves memory and makes long lists scroll smoothly.
Inputs in React Native vs Web
Inputs in React Native vs Web
Web development offers many built-in input elements like text fields, checkboxes, and dropdowns. In React Native, we use similar but specialized components instead.
Inputs in React Native vs Web
Web development offers many built-in input elements like text fields, checkboxes, and dropdowns. In React Native, we use similar but specialized components instead.
Out of the box, React Native only includes two basic input components: TextInput for typing and Switch for toggle buttons. For other inputs, you'll need additional libraries.
Inputs in React Native vs Web
Web development offers many built-in input elements like text fields, checkboxes, and dropdowns. In React Native, we use similar but specialized components instead.
Out of the box, React Native only includes two basic input components: TextInput for typing and Switch for toggle buttons. For other inputs, you'll need additional libraries.
We’ll concentrate only on these two components (TextInput and Switch)
for now.
Inputs in React Native vs Web
Web development offers many built-in input elements like text fields, checkboxes, and dropdowns. In React Native, we use similar but specialized components instead.
Out of the box, React Native only includes two basic input components: TextInput for typing and Switch for toggle buttons. For other inputs, you'll need additional libraries.
We’ll concentrate only on these two components (TextInput and Switch)
for now.
What happens to the other components?
Inputs in React Native vs Web
Web development offers many built-in input elements like text fields, checkboxes, and dropdowns. In React Native, we use similar but specialized components instead.
Out of the box, React Native only includes two basic input components: TextInput for typing and Switch for toggle buttons. For other inputs, you'll need additional libraries.
We’ll concentrate only on these two components (TextInput and Switch)
for now.
What happens to the other components?
Expo adds more tools to our development options, including extra components such as checkboxes and date pickers in its SDK.
Forms in React Native
Forms in React Native
Managing from State
Forms in React Native
Managing from State
Handling Form Validation
Forms in React Native
Managing from State
Handling Form Validation
Displaying Validation Messages
Forms in React Native
Managing from State
Handling Form Validation
Displaying Validation Messages
Submitting Form Date
Expo Router
Introduction
Introduction
What is Expo Router?
Introduction
Expo Router vs React Navigation
What is Expo Router?
What is Expo Router?
What is Expo Router?
Expo Router provides file-based routing for applications built with Expo, supporting both React Native and the web
What is Expo Router?
Expo Router provides file-based routing for applications built with Expo, supporting both React Native and the web
It's created to introduce the most effective file-system routing ideas from the web to cross-platform apps on Android, iOS, and the web
Why Expo Router?
Why Expo Router?
When working with React Native, handling navigation can be one of the biggest challenges
Why Expo Router?
When working with React Native, handling navigation can be one of the biggest challenges
React Native developers have traditionally depended on tools like React Navigation, which required manual configuration of navigators, screens, and routes
Why Expo Router?
When working with React Native, handling navigation can be one of the biggest challenges
React Native developers have traditionally depended on tools like React Navigation, which required manual configuration of navigators, screens, and routes
As your application grows, this can quickly become complex and hard to maintain
Why Expo Router?
When working with React Native, handling navigation can be one of the biggest challenges
React Native developers have traditionally depended on tools like React Navigation, which required manual configuration of navigators, screens, and routes
As your application grows, this can quickly become complex and hard to maintain
Expo Router streamlines the whole process by adopting a file-based approach
Why Expo Router?
When working with React Native, handling navigation can be one of the biggest challenges
React Native developers have traditionally depended on tools like React Navigation, which required manual configuration of navigators, screens, and routes
As your application grows, this can quickly become complex and hard to maintain
Expo Router streamlines the whole process by adopting a file-based approach
The way you organise your files and folders directly shapes your app’s navigation structure
Why Expo Router?
When working with React Native, handling navigation can be one of the biggest challenges
React Native developers have traditionally depended on tools like React Navigation, which required manual configuration of navigators, screens, and routes
As your application grows, this can quickly become complex and hard to maintain
Expo Router streamlines the whole process by adopting a file-based approach
The way you organise your files and folders directly shapes your app’s navigation structure
Expo Router apps are designed to cache and run offline-first, updating automatically when a new version is published
Why Expo Router?
Your app can process incoming native URLs without needing a network connection or server
Why Expo Router?
Your app can process incoming native URLs without needing a network connection or server
Expo Router is built on top of React Navigation
Why Expo Router?
Your app can process incoming native URLs without needing a network connection or server
Expo Router is built on top of React Navigation
It's not a full replacement, but an enhancement that makes navigation with more option and easier to manage
Tailwind CSS with React Native
Context API in React Native
Context API in React Native
The React Context API helps you share data (like themes, user info) between components without passing props manually at every level. It's useful when many components need the same data. For beginners, it makes code cleaner and easier to manage in larger apps.
Redux Toolkit in React Native
Redux Toolkit in React Native
Redux Toolkit is an official tool that makes working with Redux easier. It gives you helpful tools and follows good ways to build Redux apps
more quickly and simply.
Redux Toolkit in React Native
It makes things like setting up the store, creating reducers, and getting data from servers easier. This helps you write Redux code with less repeated work.
Redux Toolkit is an official tool that makes working with Redux easier. It gives you helpful tools and follows good ways to build Redux apps
more quickly and simply.
Redux Toolkit in React Native
It makes things like setting up the store, creating reducers, and getting data from servers easier. This helps you write Redux code with less repeated work.
Redux Toolkit is an official tool that makes working with Redux easier. It gives you helpful tools and follows good ways to build Redux apps
more quickly and simply.
Why use Redux Toolkit?
Redux Toolkit in React Native
It makes things like setting up the store, creating reducers, and getting data from servers easier. This helps you write Redux code with less repeated work.
Redux Toolkit is an official tool that makes working with Redux easier. It gives you helpful tools and follows good ways to build Redux apps
more quickly and simply.
Why use Redux Toolkit?
The createSlice function in Redux Toolkit helps you by automatically making action types, action creators, and reducers, so you don’t have to write all that code yourself.
React Native
By AZ Bytes
React Native
- 209