Hands-on React Native
1/5
()
About this ebook
In this book, we'll teach you to build your first React Native mobile app from scratch while learning the essential concepts for mobile development with JavaScript React. We'll develop a news application for Android and iOS step by step and we'll cover the following subjects:
- Creating a React Native project,
- Creating views with React components and Flexbox layout,
- Adding navigation,
- Styling UIs,
- Fetching data from remote servers and APIs,
- Listening to touch events,
- Adding images, etc.
Ahmed Bouchefra
Developer and author with a bac + 5 diploma (Master's degree) on software development. He builds apps and authors technical content about JS, Angular and Ionic. He also likes poetry and teaching.
Related to Hands-on React Native
Related ebooks
Mastering React Native Rating: 5 out of 5 stars5/5React.js Essentials Rating: 4 out of 5 stars4/5React: Building Modern Web Applications Rating: 5 out of 5 stars5/5Learn NodeJS in 1 Day: Complete Node JS Guide with Examples Rating: 3 out of 5 stars3/5Building Scalable Apps with Redis and Node.js Rating: 0 out of 5 stars0 ratingsNode.js: Novice to Ninja Rating: 0 out of 5 stars0 ratingsNode.js: Tools & Skills Rating: 0 out of 5 stars0 ratingsIan Talks JavaScript Libraries and Frameworks A-Z: WebDevAtoZ, #4 Rating: 0 out of 5 stars0 ratingsMastering React.js: Modern Web Development Rating: 0 out of 5 stars0 ratingsLearn AngularJS in 24 Hours Rating: 0 out of 5 stars0 ratingsReact Projects: Build 12 real-world applications from scratch using React, React Native, and React 360 Rating: 0 out of 5 stars0 ratingsGetting Started with React Rating: 0 out of 5 stars0 ratingsGetting Started with React Native Rating: 4 out of 5 stars4/5React and React Native Rating: 0 out of 5 stars0 ratingsReact Native By Example Rating: 0 out of 5 stars0 ratingsReactJS by Example - Building Modern Web Applications with React Rating: 4 out of 5 stars4/5React Hooks in Action: With Suspense and Concurrent Mode Rating: 5 out of 5 stars5/5React to Python: Creating React Front-End Web Applications with Python Rating: 0 out of 5 stars0 ratingsNode.JS Guidebook: Comprehensive guide to learn Node.js Rating: 0 out of 5 stars0 ratingsNode.js By Example Rating: 2 out of 5 stars2/5Redux in Action Rating: 0 out of 5 stars0 ratingsAdvanced Web Development with React: SSR and PWA with Next.js using React with advanced concepts Rating: 0 out of 5 stars0 ratingsReact Components Rating: 0 out of 5 stars0 ratingsLearn React Hooks: Build and refactor modern React.js applications using Hooks Rating: 0 out of 5 stars0 ratingsMongoose for Application Development Rating: 5 out of 5 stars5/5React Deep Dive Rating: 5 out of 5 stars5/5Express in Action: Writing, building, and testing Node.js applications Rating: 4 out of 5 stars4/550 Recipes for Programming Node.js Rating: 3 out of 5 stars3/5Node Cookbook: Second Edition Rating: 3 out of 5 stars3/5
Programming For You
Learn to Code. Get a Job. The Ultimate Guide to Learning and Getting Hired as a Developer. Rating: 5 out of 5 stars5/5Coding All-in-One For Dummies Rating: 4 out of 5 stars4/5Python Programming : How to Code Python Fast In Just 24 Hours With 7 Simple Steps Rating: 4 out of 5 stars4/5PYTHON: Practical Python Programming For Beginners & Experts With Hands-on Project Rating: 5 out of 5 stars5/5Grokking Algorithms: An illustrated guide for programmers and other curious people Rating: 4 out of 5 stars4/5Learn SQL in 24 Hours Rating: 5 out of 5 stars5/5Excel : The Ultimate Comprehensive Step-By-Step Guide to the Basics of Excel Programming: 1 Rating: 5 out of 5 stars5/5SQL QuickStart Guide: The Simplified Beginner's Guide to Managing, Analyzing, and Manipulating Data With SQL Rating: 4 out of 5 stars4/5HTML & CSS: Learn the Fundaments in 7 Days Rating: 4 out of 5 stars4/5Java for Beginners: A Crash Course to Learn Java Programming in 1 Week Rating: 5 out of 5 stars5/5Web Designer's Idea Book, Volume 4: Inspiration from the Best Web Design Trends, Themes and Styles Rating: 4 out of 5 stars4/5Learn PowerShell in a Month of Lunches, Fourth Edition: Covers Windows, Linux, and macOS Rating: 0 out of 5 stars0 ratingsRaspberry Pi Cookbook for Python Programmers Rating: 0 out of 5 stars0 ratingsPython QuickStart Guide: The Simplified Beginner's Guide to Python Programming Using Hands-On Projects and Real-World Applications Rating: 0 out of 5 stars0 ratingsPython: For Beginners A Crash Course Guide To Learn Python in 1 Week Rating: 4 out of 5 stars4/5Python Data Structures and Algorithms Rating: 5 out of 5 stars5/5OneNote: The Ultimate Guide on How to Use Microsoft OneNote for Getting Things Done Rating: 1 out of 5 stars1/5Poirot's Early Cases Rating: 5 out of 5 stars5/5The Little SAS Book: A Primer, Sixth Edition Rating: 5 out of 5 stars5/5Learn JavaScript in 24 Hours Rating: 3 out of 5 stars3/5Python Machine Learning By Example Rating: 4 out of 5 stars4/5
Reviews for Hands-on React Native
1 rating0 reviews
Book preview
Hands-on React Native - Ahmed Bouchefra
You will learn how to:
Create a React Native project,
Create views with React components and Flexbox layout,
Add navigation,
Style UIs,
Fetch data from remote servers and APIs,
Get user input,
Listen to touch events,
Add images, etc.
React Native vs. Cordova and Ionic
Unlike Cordova, Ionic and other hybrid mobile solutions, you can use React Native for writing truly-native mobile applications for Android and iOS using JavaScript, React, JSX and a bridge that invokes the native rendering APIs for the target mobile system.
––––––––
As a result, your application is actually a native application that looks and feels like the native host UI and not a web application that runs inside a web-view. This means, your app will have increased performance that can be slightly equaled to the performance of apps built using Java for Android and Swift for iOS.
––––––––
. Note: React Native apps fall slightly in terms of performance behind apps built with native languages like Java and Swift because we still have the JS bridge between the app and the native APIs.
Prerequisites
You will need the following prerequisites to successfully follow this book.
Modern ES6 features
––––––––
React Native is built on top of React - A popular JavaScript front-end library for building user interfaces, so you will need to know JavaScript including the latest ES6 features such as imports, exports and arrow functions.
––––––––
React basics
––––––––
React Native is simply React + a Native Bridge.
––––––––
So if you learn React, you’ll also end up learning most of React Native and vice versa!
––––––––
Except that for React, you’ll need to use HTML and for React Native, you need to use some predefined UI components designed for mobile UIs.
––––––––
You need to know about:
––––––––
Props and state,
The component life-cycle methods,
How to create React (class-based or function-based) components,
React Hooks,
JSX.
––––––––
JSX allows you to write XML markup inside JavaScript files. According to the official website of React, it’s defined as:
––––––––
. A syntax extension to JavaScript. We recommend using it with React to describe what the UI should look like. JSX may remind you of a template language, but it comes with the full power of JavaScript.
––––––––
React hooks — useState, useEffect and useContext
––––––––
React is now leaning toward a function-based approach for writing components with the introduction of React Hooks which allow you to access the state and other features, which were only available in class-based components before, in your function components.
––––––––
Props, state and context
––––––––
Props, state and context are important concepts in React.
––––––––
React Native components have predefined props that allow users to configure them. For example, all components have the style prop that’s used to apply styles.
––––––––
Node.js and NPM
––––––––
The React Native CLI is based on Node.js, so you will need to have Node.js 8.3+ and NPM installed on your machine.
––––––––
Testing on Android and Ubuntu 19.04
––––––––
We’ll be testing our app inside an Android emulator installed on a Ubuntu 19.04 system. So you will need to have:
––––––––
JDK 8+ and Android Studio installed on your machine.
The ANDROID_HOME environment variable set to the path of your Android SDK.
––––––––
On Ubuntu, you can add Android SDK to your PATH by adding the following