Book Image

React Native Blueprints

By : Emilio Rodriguez Martinez
Book Image

React Native Blueprints

By: Emilio Rodriguez Martinez

Overview of this book

Considering the success of the React framework, Facebook recently introduced a new mobile development framework called React Native. With React Native's game-changing approach to hybrid mobile development, you can build native mobile applications that are much more powerful, interactive, and faster by using JavaScript This project-based guide takes you through eight projects to help you gain a sound understanding of the framework and helps you build mobile apps with native user experience. Starting with a simple standalone groceries list app, you will progressively move on to building advanced apps by adding connectivity with external APIs, using native features, such as the camera or microphone, in the mobile device, integrating with state management libraries such as Redux or MobX, or leveraging React Native’s performance by building a full-featured game. This book covers the entire feature set of React Native, starting from the simplest (layout or navigation libraries) to the most advanced (integration with native code) features. By the end of this book, you’ll be able to build professional Android and iOS applications using React Native.
Table of Contents (15 chapters)
Title Page
Credits
About the Author
About the Reviewers
www.PacktPub.com
Customer Feedback
Preface

Preface

React Native helps web and mobile developers to build apps for iOS and Android apps that perform at the same level as any other natively developed app. The range of apps that can be built using this library is huge. From e-commerce to games, React Native is a good fit for any mobile project due to its flexibility and extendable nature. It has good performance, reuses React knowledge, has the ability to import npm packages, and uses the same codebase for iOS and Android. There's no doubt React Native is not only a good alternative to native development, but also a great way to introduce web developers to a mobile project. This book aims to give JavaScript and React developers a peek at how some of the most popular apps in the market could be built from scratch with React Native. We will build all the apps in iOS and Android, except for those cases where the apps only make sense on one of the platforms.

What this book covers

Chapter 1, Shopping List, shows how a groceries list can be built in React Native using simple navigation and introducing some of the most common native components.

Chapter 2, RSS Reader, teaches you how to create a news feed reader using RSS.

Chapter 3, Car Booking App, explains how some of the most popular car-sharing apps could have been developed using React Native.

Chapter 4, Image Sharing App, teaches you the fundamentals of how a social network based on image sharing can be created with React Native.

Chapter 5, Guitar Tuner, is one of the apps that require components not yet available in React Native. We will build one of these native components and use it from a React Native app.

Chapter 6, Messaging App, 1:1 messaging apps are the most popular apps in the stores. In this chapter, we will build a full-featured messaging app including push notifications and cloud-based storage.

Chapter 7, Game, is fun and shows you the fundamentals of how a 2D game can be developed using React Native.

Chapter 8E-Commerce App, uses React Native to build one of the most requested types of app in the market: an e-commerce app to buy and sell products online.

What you need for this book

Most of the apps built throughout this book will run on Android and iOS, so a computer running Linux, Windows, or OSX will be required, although we recommend any Apple computer (running OSX 10 or later) to run both mobile platforms at once, as some examples will require working on XCode, which is only installable on OSX.

Other pieces of software we will use in examples are:

  • XCode
  • Android Studio
  • A React-ready IDE (such as Atom, VS Code, and SublimeText)

And of course, we will need React Native and React Native CLI installed (https://facebook.github.io/react-native/docs/getting-started.html).

Who this book is for

This book is targeted at JavaScript developers trying to understand how different kinds of apps can be built using React Native. They will find a set of best practices and proven architectural strategies that can be applied to building any kind of app.

Although some basic concepts of React won't be explained in this book, no specific React skills are needed to follow along, since we won't dive deep into complex React patterns.

Conventions

In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "We have to create an src folder where we will store all our React code."

Also in big code blocks, when some pieces of code are not relevant or reviewed in a different place, they will be replaced by an ellipsis (...).

A block of code is set as follows:

/*** index.js ***/

import { AppRegistry } from 'react-native';
import App from './src/main';
AppRegistry.registerComponent('GroceriesList', () => App);

Any command-line input or output is written as follows:

react-native run-ios

New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "The back button on the Add a product screen."

Note

Tips and important notes appear in a box like this.

Note

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book--what you liked or disliked. Reader feedback is important to us as it helps us develop titles that you will really get the most out of. To send us general feedback, simply email [email protected], and mention the book's title in the subject of your message. If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for this book from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you. You can download the code files by following these steps:

  1. Log in or register to our website using your e-mail address and password.
  2. Hover the mouse pointer on the SUPPORT tab at the top.
  3. Click on Code Downloads & Errata.
  4. Enter the name of the book in the Search box.
  5. Select the book for which you're looking to download the code files
  6. Choose from the drop-down menu where you purchased this book from.
  7. Click on Code Download.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

  • WinRAR / 7-Zip for Windows
  • Zipeg / iZip / UnRarX for Mac
  • 7-Zip / PeaZip for Linux

The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/React-Native-Blueprints. We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Downloading the color images of this book

We also provide you with a PDF file that has color images of the screenshots/diagrams used in this book. The color images will help you better understand the changes in the output. You can download this file from https://www.packtpub.com/sites/default/files/downloads/ReactNativeBlueprints_ColorImages.pdf.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books-maybe a mistake in the text or the code--we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.

To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.

Piracy

Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at [email protected] with a link to the suspected pirated material.

We appreciate your help in protecting our authors and our ability to bring you valuable content.

Questions

If you have a problem with any aspect of this book, you can contact us at [email protected], and we will do our best to address the problem.