Real-World Applications Built with React Native
Course: React Native Training
Topic: Real-World Applications Built with React Native
Course Link: React Native Training Course – JustAcademy
Demo Link: Register for a Course Demo
JustAcademy Website: Visit JustAcademy
1. Introduction to Real-World React Native Applications
React Native is an open-source framework used to build mobile applications with React and JavaScript or TypeScript. It enables developers to share a significant portion of their application code across Android and iOS while using native platform user interface components.
React Native is used in a wide variety of products, including e-commerce platforms, business applications, messaging tools, productivity apps, financial services, fitness applications, and customer support systems. Its reusable components and shared application logic make it useful for teams that need to deliver features across multiple mobile platforms.
Real-world applications are more complex than simple demonstration projects. They often require authentication, API integration, navigation, data storage, notifications, accessibility, security, performance optimization, testing, and deployment.
1.1 What Is a Real-World Application?
A real-world application is software designed to solve a practical problem for actual users. It must work reliably under everyday conditions, handle unexpected errors, protect user information, and provide a clear user experience.
Examples include:
- An online shopping application that allows users to search for products and place orders.
- A messaging application that supports conversations and notifications.
- A fitness application that records activities and displays progress.
- A financial application that displays account information securely.
- A business application that helps employees manage tasks and reports.
- A travel application that supports bookings, maps, and trip information.
1.2 Learning Objectives
After completing this topic, learners should be able to:
- Explain how React Native is used in real-world applications.
- Identify major industries that use React Native.
- Understand common features of production mobile applications.
- Explain how React Native applications connect to APIs and databases.
- Understand authentication, navigation, state management, and local storage.
- Recognize security, testing, and performance requirements.
- Design and implement a practical React Native project.
- Explain how to prepare an application for production deployment.
2. Why Businesses Use React Native
Businesses select React Native when its development model, ecosystem, and platform support fit their product requirements. The framework allows teams to build native mobile interfaces while reusing many components and business rules.
2.1 Code Reusability
Many features can be implemented once and shared across Android and iOS. Examples include form validation, product calculations, API service functions, and reusable interface components.
2.2 Consistent User Experience
Reusable design components help maintain consistent branding, typography, form behavior, and business workflows. Developers can still make platform-specific adjustments where Android and iOS conventions differ.
2.3 Faster Feature Development
When an application shares substantial functionality across platforms, developers can often implement common features without maintaining two entirely separate implementations. Actual time savings depend on the complexity of the app and its native integrations.
2.4 Access to Native Features
React Native applications can integrate with platform capabilities through framework APIs, supported libraries, and native modules. Depending on the project, these capabilities may include camera access, location services, notifications, biometric authentication, and device storage.
2.5 Flexible Application Architecture
Developers can organize applications into reusable components, screens, navigation structures, data services, and business logic modules. This supports maintainability as the product grows.
2.6 JavaScript and React Ecosystem
Teams familiar with React and JavaScript can apply their knowledge of components, hooks, state management, and modular programming to mobile application development.
3. Examples of Real-World Applications Using React Native
The official React Native showcase lists applications from organizations including Microsoft, Amazon, Shopify, and Wix. The technologies used by individual products can evolve over time, and an organization may use React Native for selected features rather than every screen or module. Explore the official React Native showcase.
3.1 Shopify
Shopify is an e-commerce platform that helps businesses manage online stores, products, orders, and sales. The React Native showcase identifies Shopify and related mobile products as examples of React Native use.
Relevant application features include:
- Store and product management.
- Order and customer information.
- Business dashboards and notifications.
- Reusable forms and list interfaces.
- API integration for retrieving and updating business data.
What developers can learn: Business applications often rely on data-driven screens, reusable forms, authenticated API requests, and reliable state management.
3.2 Microsoft Applications
The React Native showcase identifies Microsoft products such as Microsoft Office, Outlook, Teams, and Xbox Game Pass among its examples. Individual products can combine multiple technologies and platform-specific components.
Common application patterns include:
- Account-based experiences.
- Information dashboards.
- Messaging and collaboration features.
- Document and content management.
- Notifications and synchronization.
What developers can learn: Productivity applications need clear navigation, efficient data handling, accessibility, synchronization, and careful management of application state.
3.3 Amazon Applications
The official showcase lists Amazon Shopping, Amazon Alexa, Amazon Photos, and Amazon Kindle as examples associated with React Native.
Common application patterns include:
- Search and discovery interfaces.
- Product or content detail screens.
- Personalized recommendations.
- Image and media handling.
- Account settings and preferences.
What developers can learn: Applications with large data collections benefit from efficient lists, image optimization, responsive navigation, and thoughtful loading and error states.
3.4 Wix Applications
The React Native showcase identifies Wix applications such as Spaces, Dine by Wix, Fit by Wix, and Wix Owner. These products illustrate the variety of business and customer-facing experiences that can be built with shared mobile development technologies.
Common application patterns include:
- Business profiles and service information.
- Customer engagement.
- Scheduling and content management.
- Forms and account settings.
- Data-driven screens and notifications.
What developers can learn: Reusable components can help maintain consistent user experiences across different application features and products.
3.5 Facebook Ads Manager and Other Meta Products
The React Native showcase includes Facebook Ads Manager and other products within Meta's ecosystem. The showcase illustrates that React Native is used in large, established product environments.
Relevant application patterns include:
- Account and campaign dashboards.
- Data summaries and performance metrics.
- Interactive forms and filters.
- Notifications and status updates.
- API-driven content and analytics.
What developers can learn: Applications with dashboards require clear data presentation, efficient rendering, robust error handling, and appropriate access controls.
3.6 Other Applications in the React Native Showcase
The official showcase also lists examples such as Flipkart, Discord, Bloomberg, Coinbase, PlayStation App, PUMA, and others. Their inclusion demonstrates the range of products associated with the framework, but it does not imply that every feature in each product is implemented with React Native.
Reference: React Native – Official Application Showcase.
4. Industries Where React Native Is Used
4.1 E-Commerce and Retail
E-commerce applications allow users to browse products, search for items, compare prices, manage shopping carts, place orders, and track deliveries.
Common features:
- Product catalogs and categories.
- Search, filtering, and sorting.
- Shopping cart and checkout.
- Customer accounts and order history.
- Payment gateway integration.
- Push notifications and delivery updates.
React Native concepts involved: FlatList, reusable product cards, navigation, API requests, form validation, application state, and loading indicators.
4.2 Social Networking and Messaging
Social and messaging applications connect users and support the exchange of messages, images, and other content.
Common features:
- User profiles and account settings.
- Conversation lists and message screens.
- Image and file attachments.
- Notifications and unread-message counts.
- Search and contact discovery.
- Blocking, reporting, and privacy controls.
Real-time communication may require WebSockets, push notifications, or other backend services. React Native provides the user interface and application logic, while the backend and communication infrastructure support message delivery and synchronization.
4.3 Banking and FinTech
Financial applications provide account information, transaction histories, transfers, bill payments, and other financial services.
Common features:
- Secure authentication.
- Account and transaction dashboards.
- Payment and transfer workflows.
- Transaction confirmation.
- Biometric authentication where supported.
- Fraud monitoring and security notifications.
Financial applications require strong security controls, server-side authorization, secure session handling, auditability, and compliance with applicable regulations. A mobile framework alone does not guarantee security.
4.4 Healthcare and Wellness
Healthcare and wellness applications can support appointment booking, fitness tracking, reminders, health education, and access to authorized records.
Common features:
- Appointment scheduling.
- Personal profiles and preferences.
- Activity tracking and progress charts.
- Medication or appointment reminders.
- Secure access to health-related information.
- Communication with authorized services.
Applications handling sensitive information must apply appropriate privacy, security, consent, and data-retention controls.
4.5 Education and E-Learning
Educational applications allow students to access lessons, quizzes, learning materials, and progress reports from mobile devices.
Common features:
- Course catalogs and lesson screens.
- Video and document content.
- Quizzes and assessments.
- Progress tracking.
- Bookmarks and learning history.
- Notifications about deadlines or new lessons.
Developers can use reusable lesson cards, navigation components, API services, and local storage for selected preferences or offline content.
4.6 Travel and Transportation
Travel applications help users search for destinations, reserve services, manage itineraries, and receive travel updates.
Common features:
- Destination and service search.
- Booking forms and confirmation screens.
- Maps and location services.
- Itinerary management.
- Payment integration.
- Real-time status notifications.
Location features require permission handling, appropriate background behavior, and clear explanations of why location data is needed.
4.7 Food Delivery
Food delivery applications connect customers, restaurants, and delivery partners through ordering and tracking workflows.
Common features:
- Restaurant and menu listings.
- Cart management and checkout.
- Order status updates.
- Delivery location information.
- Customer support and ratings.
- Notifications about order progress.
4.8 Real Estate
Real estate applications help users search for properties, view photos, compare listings, and contact agents.
Common features:
- Property listings and filters.
- Photo galleries and property details.
- Map-based discovery.
- Saved listings and favorites.
- Appointment scheduling.
- Inquiry forms and messaging.
4.9 Enterprise and Productivity
Enterprise applications support internal business processes such as task management, inventory control, employee scheduling, reporting, and customer relationship management.
Common features:
- Role-based access.
- Forms and workflow approvals.
- Dashboards and reports.
- Task assignments.
- Search and filtering.
- Offline support for selected workflows.
5. Core Features of a Production React Native Application
Most real-world applications combine multiple features. Understanding these building blocks helps developers move beyond simple screens and create maintainable applications.
5.1 User Authentication
Authentication identifies a user before allowing access to protected features. Depending on the application, it may use passwords, one-time codes, federated sign-in, or other authentication methods.
Common screens include:
- Login screen.
- Registration screen.
- Password recovery screen.
- Verification screen.
- Profile and account settings.
5.2 Navigation
Navigation allows users to move between screens and application workflows. A production application may use stack navigation, tab navigation, drawer navigation, modal screens, or a combination of these patterns.
Navigation should support expected back behavior, protected routes, deep links where required, and a clear information hierarchy.
5.3 API Integration
Applications commonly retrieve information from a backend service through HTTP APIs. The frontend sends requests, processes responses, and displays information to users.
Examples include retrieving products, loading account details, creating orders, updating profiles, and submitting forms.
5.4 State Management
State management controls data that changes while the application is running. Examples include form values, selected filters, authentication status, shopping-cart contents, and the results of API requests.
Simple screens may use React hooks such as useState and useReducer. Larger applications may use context or a dedicated state-management library depending on their needs.
5.5 Local Storage
Local storage can preserve selected information between application sessions. Appropriate use cases include user preferences, cached data, and selected offline content.
Sensitive information should be stored only with suitable protection. Ordinary unencrypted storage should not be used for secrets or credentials that require secure storage.
5.6 Notifications
Push notifications can inform users about messages, bookings, delivery updates, reminders, or other events. Notification delivery commonly requires backend services and platform-specific configuration.
5.7 Error Handling
A production application should handle failed requests, invalid inputs, timeouts, unavailable services, and unexpected responses. Clear messages and appropriate retry options help users recover from problems.
5.8 Accessibility
Accessibility helps people with different abilities use the application. Developers should consider screen-reader labels, text scaling, sufficient contrast, touch-target size, keyboard behavior, and logical navigation.
6. Architecture of a Real-World React Native App
A well-organized architecture separates user interface components, business logic, data access, and platform integrations. The exact structure depends on the project's size and requirements.
6.1 Presentation Layer
This layer contains screens and reusable UI components, such as buttons, cards, forms, headers, and lists.
6.2 Business Logic Layer
This layer handles application rules such as calculating prices, validating data, applying discounts, checking task status, and determining which actions are allowed in the interface.
6.3 Data and Service Layer
This layer handles API requests, response processing, caching, local persistence, and communication with backend services.
6.4 Platform Integration Layer
This layer connects the application to device features and platform-specific services, including notifications, location, camera access, and selected native SDKs.
6.5 Example Architecture
React Native Application
|
+-- Screens
| +-- LoginScreen
| +-- HomeScreen
| +-- DetailsScreen
| +-- ProfileScreen
|
+-- Components
| +-- Button
| +-- InputField
| +-- ProductCard
| +-- LoadingIndicator
|
+-- Services
| +-- authService
| +-- productService
| +-- orderService
|
+-- State Management
|
+-- Local Storage
|
+-- Platform Integrations
|
+-- Backend APIs
6.6 Benefits of a Modular Architecture
- Makes components easier to reuse.
- Separates interface code from business rules.
- Improves testability and debugging.
- Supports teamwork across different application areas.
- Helps maintain the application as new features are added.
7. Practical Example: E-Commerce Application
This example demonstrates how React Native concepts can be used to create a simple product catalog. A production shopping application would add navigation, a backend API, authentication, cart persistence, checkout, payment integration, and order management.
7.1 Project Requirements
- Display a list of products.
- Show product names and prices.
- Allow users to add products to a cart.
- Display the number of items added.
- Use reusable components.
7.2 Sample Implementation
import React, { useState } from 'react';
import {
View,
Text,
FlatList,
Pressable,
StyleSheet,
} from 'react-native';
const PRODUCTS = [
{ id: '1', name: 'Wireless Headphones', price: 2499 },
{ id: '2', name: 'Smart Watch', price: 3999 },
{ id: '3', name: 'Bluetooth Speaker', price: 1799 },
];
function ProductCard({ product, onAdd }) {
return (
<View style={styles.card}>
<Text style={styles.productName}>
{product.name}
</Text>
<Text>₹{product.price.toLocaleString('en-IN')}</Text>
<Pressable
style={styles.button}
onPress={() => onAdd(product)}
accessibilityRole="button"
accessibilityLabel={`Add ${product.name} to cart`}
>
<Text style={styles.buttonText}>Add to Cart</Text>
</Pressable>
</View>
);
}
export default function App() {
const [cart, setCart] = useState([]);
function addToCart(product) {
setCart(currentCart => [...currentCart, product]);
}
return (
<View style={styles.container}>
<Text style={styles.heading}>My Store</Text>
<Text style={styles.cartCount}>
Cart Items: {cart.length}
</Text>
<FlatList
data={PRODUCTS}
keyExtractor={item => item.id}
renderItem={({ item }) => (
<ProductCard product={item} onAdd={addToCart} />
)}
/>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
padding: 20,
paddingTop: 55,
},
heading: {
fontSize: 28,
fontWeight: 'bold',
marginBottom: 12,
},
cartCount: {
fontSize: 16,
marginBottom: 16,
},
card: {
padding: 16,
borderWidth: 1,
borderColor: '#DDDDDD',
borderRadius: 8,
marginBottom: 12,
},
productName: {
fontSize: 18,
fontWeight: 'bold',
marginBottom: 8,
},
button: {
marginTop: 12,
padding: 12,
borderRadius: 6,
backgroundColor: '#2457C5',
alignItems: 'center',
},
buttonText: {
color: '#FFFFFF',
fontWeight: 'bold',
},
});
7.3 Code Explanation
PRODUCTS contains sample product information.
ProductCard is a reusable component for displaying a product.
useState stores the current cart items.
addToCart() adds a product to the cart state.
FlatList displays the product collection.
Pressable responds to user interactions.
StyleSheet.create() defines reusable styles.
7.4 Limitations of This Example
This example stores product data directly in the source code and keeps cart information in memory. It is suitable for learning component reuse and state management, but it is not a complete production shopping application.
A production implementation should retrieve product information from a backend, calculate prices securely on the server, validate inventory, integrate a suitable payment provider, persist appropriate cart data, and handle failed requests.
8. API Integration in Real-World Applications
APIs allow a React Native application to communicate with backend systems. The backend may handle business rules, user accounts, database operations, payments, permissions, and other services.
8.1 Example of Fetching Data
async function fetchProducts() {
const response = await fetch(
'https://example.com/api/products'
);
if (!response.ok) {
throw new Error('Unable to load products');
}
return response.json();
}
Explanation:
fetch() sends an HTTP request to the specified endpoint.
response.ok indicates whether the response status is successful.
response.json() parses the response body as JSON.
- The calling component should handle errors and display suitable loading and error states.
Important: The URL above is an illustrative placeholder, not a working product API. Replace it with the endpoint for your own backend or a suitable development API.
8.2 Common API Operations
| HTTP Method |
Typical Purpose |
Example |
| GET |
Retrieve information |
Load product details |
| POST |
Create a resource or submit an operation |
Create an order |
| PUT |
Replace a resource |
Update a complete profile |
| PATCH |
Update selected fields |
Change a task's status |
| DELETE |
Delete a resource |
Remove a saved item |
8.3 API Integration Best Practices
- Handle unsuccessful HTTP responses.
- Display loading indicators while requests are pending.
- Provide meaningful error messages.
- Use request timeouts or cancellation where appropriate.
- Validate API response data before relying on it.
- Keep private credentials out of the application bundle.
- Apply authentication and authorization on the backend.
- Avoid logging passwords, tokens, or other sensitive data.
9. Authentication and User Management
Many real-world applications need user accounts. Authentication confirms a user's identity, while authorization determines which resources and actions that user is allowed to access.
9.1 Common Authentication Workflow
- The user opens the application.
- The application displays the login or registration screen.
- The user submits the required information.
- The backend validates the request.
- The backend returns an appropriate result and, where applicable, session credentials.
- The application stores credentials using an appropriate secure approach.
- The user accesses authorized screens and services.
9.2 Authentication Best Practices
- Use a trusted authentication system appropriate to the project.
- Use secure communication for authentication requests.
- Store sensitive tokens using suitable secure storage when needed.
- Enforce authorization checks on the server.
- Handle expired sessions and sign-out behavior.
- Protect account recovery and verification workflows.
- Do not treat a hidden screen as a substitute for backend authorization.
10. Data Storage and Offline Support
Real-world applications often need to preserve selected data between sessions or continue supporting users when connectivity is limited. Storage choices depend on the type and sensitivity of the data.
10.1 Types of Storage
| Storage Type |
Common Use |
Considerations |
| Component state |
Temporary form values and UI state |
Usually lost when the component or app session resets |
| AsyncStorage or similar preferences storage |
Non-sensitive settings and small persistent values |
Not intended for secrets requiring secure storage |
| Secure storage |
Selected credentials or sensitive tokens |
Use a maintained library that uses platform security facilities appropriately |
| Local database |
Structured offline data and larger local collections |
Requires a data model, migration plan, and synchronization strategy where applicable |
| Remote database through an API |
Shared accounts, orders, and synchronized application data |
Requires backend authorization, validation, and network error handling |
10.2 Offline-First Features
Offline support can allow users to access cached content or create local changes while disconnected. When the network becomes available, the application may synchronize changes with a server.
Developers must plan for conflicting updates, stale data, duplicate requests, failed synchronization, and the possibility that the server rejects a change.
11. Notifications and Device Features
Mobile applications frequently integrate with device features to provide a more useful experience. These features may require permission prompts, native configuration, and platform-specific testing.
11.1 Push Notifications
Push notifications can alert users about messages, delivery updates, bookings, reminders, and other events. A typical implementation includes a notification service, device registration, backend event processing, and notification handling within the application.
11.2 Camera and Image Upload
Applications may use camera or image-picker libraries to let users capture or select photos. Developers should handle permissions, image size, upload progress, and failed uploads.
11.3 Location Services
Location services support maps, navigation, nearby search, and delivery tracking. Request location access only when needed and provide an appropriate experience when permission is denied.
11.4 Biometrics
Biometric authentication can use supported device capabilities such as fingerprint or facial authentication. It should be implemented through appropriate platform APIs and combined with a secure authentication design.
11.5 Platform Integration Checklist
- Confirm the library supports the required platforms.
- Follow setup and permission instructions.
- Test denied and restricted permission states.
- Check device and operating-system compatibility.
- Provide alternatives when a capability is unavailable.
- Review privacy implications before collecting device data.
12. Testing Real-World React Native Applications
Testing helps ensure that features work correctly, data is handled safely, and the application remains reliable across supported devices.
12.1 Unit Testing
Unit tests check individual functions and business rules, such as cart totals, form validation, or date calculations.
12.2 Component Testing
Component tests verify that UI components render correctly and respond to user interactions. For example, a test may check whether pressing an Add to Cart button triggers the expected callback.
12.3 Integration Testing
Integration tests check whether multiple modules work together, such as a login form, authentication service, and application state.
12.4 End-to-End Testing
End-to-end tests validate complete workflows, such as signing in, searching for a product, adding it to a cart, and confirming an order.
12.5 Cross-Platform Testing Checklist
- Test the application on Android and iOS.
- Check layouts on different screen sizes.
- Test navigation and keyboard behavior.
- Verify authentication and session expiry.
- Test API success, failure, and timeout conditions.
- Check offline and reconnection behavior.
- Verify permission handling and device integrations.
- Test accessibility labels and text scaling.
- Review performance in production-like builds.
13. Performance Optimization
A production application should respond quickly to user interactions and manage memory, network requests, and rendering efficiently. Optimization should be based on measurements and representative device testing.
13.1 Efficient List Rendering
Use FlatList or another appropriate virtualized list for large collections instead of rendering every item at once. Keep row components efficient and use stable keys for list items.
13.2 Image Optimization
- Use image sizes appropriate for the displayed layout.
- Compress images where suitable.
- Consider caching for frequently viewed content.
- Avoid downloading full-resolution images when they are not needed.
13.3 Reduce Unnecessary Re-Renders
Keep state appropriately scoped and avoid unnecessary updates. Use memoization tools when profiling shows they are beneficial rather than applying them everywhere.
13.4 Network Optimization
Use pagination, caching, and request deduplication where appropriate. Display loading feedback and handle slow or unreliable networks gracefully.
13.5 Monitor Application Performance
Measure startup time, scrolling performance, crash rates, network behavior, and memory usage. Development mode may behave differently from production builds, so validate important findings under realistic conditions.
14. Security Best Practices
Security is essential in production applications, especially when they handle personal information, payment data, account credentials, or private business records.
14.1 Secure Communication
Use HTTPS for network requests and configure the backend to enforce appropriate authentication and authorization rules.
14.2 Secure Sensitive Data
Use suitable platform-backed secure storage for sensitive credentials when required. Do not embed private server secrets in the mobile application because application packages can be inspected.
14.3 Validate Data on the Server
Client-side validation improves user experience, but important rules must also be enforced on the server. Never rely solely on the mobile interface to authorize sensitive actions.
14.4 Protect User Privacy
Collect only the data necessary for the application's purpose, request permissions transparently, and follow applicable privacy and data-protection requirements.
14.5 Maintain Dependencies
Use supported libraries, monitor security advisories, and test framework upgrades before releasing them to users.
15. Deployment and Maintenance
Deploying a React Native application involves more than generating an APK or iOS build. Teams must configure application identity, signing, versioning, privacy disclosures, testing, and store submission requirements.
15.1 Android Release
- Configure the application identifier and version.
- Prepare the appropriate release build.
- Configure signing and protect signing credentials.
- Test the production build on representative devices.
- Prepare store listing information and required privacy details.
- Follow the relevant distribution channel's requirements.
15.2 iOS Release
- Configure the bundle identifier and version information.
- Set up appropriate signing and provisioning.
- Build and test the application.
- Prepare the store listing and privacy disclosures.
- Submit through the appropriate Apple distribution process when applicable.
15.3 Post-Release Maintenance
After deployment, teams should monitor crashes, performance, user feedback, security issues, and compatibility with new operating-system versions. Updates should include regression testing and careful dependency management.
16. Mini Project: Build a Real-World Task Management App
This mini project applies React Native concepts to a practical productivity application. It can be extended into a portfolio project by adding persistent storage, authentication, API integration, and automated tests.
16.1 Project Objective
Create a mobile task manager that allows users to add tasks, mark them complete, delete tasks, and view the current task list.
16.2 Project Requirements
- Provide an input field for a new task.
- Add a task when the user submits valid text.
- Display tasks in a scrollable list.
- Allow tasks to be marked complete.
- Allow tasks to be deleted.
- Display an empty state when no tasks exist.
- Use reusable UI components and shared business logic.
- Test the application on Android and iOS.
16.3 Sample Implementation
import React, { useState } from 'react';
import {
View,
Text,
TextInput,
Pressable,
FlatList,
StyleSheet,
} from 'react-native';
export default function App() {
const [title, setTitle] = useState('');
const [tasks, setTasks] = useState([]);
function addTask() {
const trimmedTitle = title.trim();
if (!trimmedTitle) {
return;
}
setTasks(current => [
...current,
{
id: `${Date.now()}-${Math.random()}`,
title: trimmedTitle,
completed: false,
},
]);
setTitle('');
}
function toggleTask(id) {
setTasks(current =>
current.map(task =>
task.id === id
? { ...task, completed: !task.completed }
: task
)
);
}
function deleteTask(id) {
setTasks(current =>
current.filter(task => task.id !== id)
);
}
return (
<View style={styles.container}>
<Text style={styles.heading}>Task Manager</Text>
<TextInput
style={styles.input}
placeholder="Enter a task"
value={title}
onChangeText={setTitle}
/>
<Pressable style={styles.button} onPress={addTask}>
<Text style={styles.buttonText}>Add Task</Text>
</Pressable>
{tasks.length === 0 ? (
<Text>No tasks available. Add your first task.</Text>
) : (
<FlatList
data={tasks}
keyExtractor={item => item.id}
renderItem={({ item }) => (
<View style={styles.taskRow}>
<Pressable
style={styles.taskTitle}
onPress={() => toggleTask(item.id)}
>
<Text>
{item.completed ? '✓ ' : ''}
{item.title}
</Text>
</Pressable>
<Pressable onPress={() => deleteTask(item.id)}>
<Text style={styles.deleteText}>Delete</Text>
</Pressable>
</View>
)}
/>
)}
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
padding: 20,
paddingTop: 55,
},
heading: {
fontSize: 26,
fontWeight: 'bold',
marginBottom: 20,
},
input: {
borderWidth: 1,
borderColor: '#999999',
padding: 12,
borderRadius: 6,
marginBottom: 10,
},
button: {
backgroundColor: '#2457C5',
padding: 12,
borderRadius: 6,
alignItems: 'center',
marginBottom: 20,
},
buttonText: {
color: '#FFFFFF',
fontWeight: 'bold',
},
taskRow: {
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'space-between',
paddingVertical: 12,
borderBottomWidth: 1,
borderBottomColor: '#DDDDDD',
},
taskTitle: {
flex: 1,
paddingRight: 12,
},
deleteText: {
color: '#B00020',
},
});
16.4 Concepts Practiced
useState manages the input and task collection.
addTask() adds a task after validating the input.
toggleTask() updates the completion status.
deleteTask() removes a task from the collection.
FlatList displays the list efficiently.
Pressable handles button and task interactions.
StyleSheet organizes interface styling.
16.5 Improvements for a Production Version
- Add local persistence so tasks survive application restarts.
- Add user registration and authentication if accounts are required.
- Connect the app to a backend API for synchronization.
- Add task priorities, categories, and due dates.
- Improve accessibility and screen-reader support.
- Add automated tests for task operations.
- Implement loading, error, and offline states.
- Test performance and behavior on Android and iOS.
17. Common Problems in Real-World Applications
| Problem |
Possible Cause |
Solution |
| API data does not appear |
Network failure, invalid endpoint, or response parsing issue |
Check the request, status code, response structure, and error handling. |
| Login fails unexpectedly |
Invalid credentials, expired session, or backend error |
Inspect the response safely and verify authentication configuration. |
| List scrolling is slow |
Expensive row rendering or inefficient list implementation |
Use an appropriate virtualized list and profile performance. |
| Application crashes on a device |
Runtime error, native dependency issue, or device-specific behavior |
Review crash logs and reproduce the issue on the affected platform. |
| Data disappears after restart |
Data exists only in memory |
Implement suitable persistent storage or server synchronization. |
| Notifications do not arrive |
Permission, device registration, or server configuration problem |
Check notification setup, token registration, and platform-specific requirements. |
| Layout differs between platforms |
Different system behavior or screen dimensions |
Test both platforms and apply targeted layout adjustments. |
| Release build fails |
Signing, configuration, or dependency compatibility issue |
Review build logs and verify the release configuration. |
18. Best Practices for Building Production Applications
- Understand the user's problem before designing the application.
- Choose a framework and libraries that fit the project requirements.
- Use reusable components and modular architecture.
- Separate presentation, business logic, and data access.
- Handle API errors and network interruptions.
- Protect sensitive information and enforce server-side authorization.
- Follow accessibility and platform interface conventions.
- Test on Android and iOS throughout development.
- Measure performance on representative devices.
- Maintain dependencies and plan upgrades.
- Automate appropriate tests and release checks.
- Monitor the application after deployment and respond to user feedback.
19. Practice Exercises
19.1 Theory Questions
- What is React Native, and why do businesses use it?
- List five industries where React Native applications can be useful.
- Explain the role of APIs in a mobile application.
- Differentiate authentication and authorization.
- Why is secure storage important in financial applications?
- Explain how React Native applications can access device capabilities.
- Why should production applications be tested on both Android and iOS?
- What are the benefits of reusable components?
- Explain why offline support requires a synchronization strategy.
- Describe three performance optimization techniques.
19.2 Practical Exercises
- Build a product listing screen with reusable product cards.
- Create a login screen with basic input validation.
- Fetch data from a test API and display it using FlatList.
- Add loading, empty, and error states to a data-driven screen.
- Build a task manager with add, complete, and delete operations.
- Persist non-sensitive preferences locally.
- Implement platform-aware behavior using the Platform module.
- Write tests for a cart calculation or task-management function.
19.3 Portfolio Assignment
Build a cross-platform shopping or task management application. Include at least three screens, reusable components, navigation, API integration, input validation, loading and error handling, and tests for important business logic.
Prepare a project report explaining the application requirements, architecture, technology choices, platform-specific behavior, security considerations, test strategy, and future improvements. Clearly distinguish completed features from planned features.
20. Interview Questions and Answers
Q1. What is React Native?
Answer: React Native is an open-source framework for building native mobile applications using React and JavaScript or TypeScript.
Q2. Can React Native be used for production applications?
Answer: Yes. React Native is used in production applications, but the suitability of the framework depends on the app's requirements, integrations, performance needs, and maintenance strategy.
Q3. Name some products listed in the official React Native showcase.
Answer: Examples include Shopify, Microsoft Office, Microsoft Outlook, Amazon Shopping, Wix applications, and Facebook Ads Manager. Product implementations can combine multiple technologies and may change over time.
Q4. What are reusable components?
Answer: Reusable components are UI elements that can be used in multiple parts of an application, such as buttons, form fields, product cards, and list items.
Q5. How does a React Native app retrieve data from a server?
Answer: It can make HTTP requests to backend APIs, parse responses, update application state, and render the retrieved data.
Q6. What is state management?
Answer: State management is the process of storing and updating application data that changes over time, such as form input, cart items, and API results.
Q7. Why is API error handling important?
Answer: Requests may fail because of connectivity problems, server errors, invalid data, or expired sessions. Error handling helps the application recover and informs the user about the problem.
Q8. How can sensitive information be protected?
Answer: Use secure communication, appropriate secure storage, server-side authorization, careful logging, and suitable authentication practices.
Q9. Why is FlatList useful?
Answer: FlatList supports efficient rendering of scrollable data collections, making it useful for product catalogs, messages, and task lists.
Q10. What is the difference between local storage and a backend database?
Answer: Local storage keeps data on the device, while a backend database stores data on a server and can support shared access, synchronization, and server-side processing.
Q11. What should be tested before releasing an application?
Answer: Test important workflows, API behavior, authentication, permissions, accessibility, performance, error states, and compatibility on supported Android and iOS devices.
Q12. What makes a React Native application production-ready?
Answer: A production-ready app has reliable functionality, suitable security controls, maintainable architecture, tested platform behavior, appropriate performance, error handling, release configuration, and an ongoing maintenance plan.
21. Quick Revision Checklist
- React Native supports native mobile application development with React.
- Real-world applications often share code across Android and iOS.
- Examples in the official showcase include products from Shopify, Microsoft, Amazon, Wix, and Meta.
- Applications can serve e-commerce, education, finance, healthcare, travel, and business needs.
- Common building blocks include navigation, state management, API services, authentication, and local storage.
- Device integrations may require permissions, native modules, and platform-specific configuration.
- Security, accessibility, and performance are essential production concerns.
- Testing should cover Android and iOS, including failure and offline scenarios.
- Deployment requires platform-specific signing, build configuration, and release preparation.
- Real-world projects should be modular, testable, and maintainable.
22. Conclusion
Real-world applications built with React Native demonstrate how a shared development approach can support mobile products across multiple industries. The framework provides reusable components and a React-based programming model while allowing integration with native platform capabilities.
Building a successful production application requires more than creating screens. Developers must understand API integration, authentication, data storage, state management, security, accessibility, testing, performance optimization, and deployment. These practices help transform a simple prototype into a reliable application that can be maintained as user needs grow.
Start by building a small project, such as a task manager or product catalog, and gradually add navigation, API integration, persistence, testing, and production-ready error handling.
Official reference: Explore real-world applications in the React Native showcase.
Learn React Native with JustAcademy: View the React Native Training Course or register for a course demo.