Skip to main content
main-content
Top

About this book

Develop native iOS and Android apps with ease using React Native. Learn by doing through an example-driven approach, and have a substantial running app at the end of each chapter. This second edition is fully updated to include ES7 (ECMAScript 7), the latest version of React Native (including Redux), and development on Android.

You will start by setting up React Native and exploring the anatomy of React Native apps. You'll then move on to Redux data flow, how it differs from flux, and how you can include it in your React Native project to solve state management differently and efficiently. You will also learn how to boost your development by including popular packages developed by the React Native community that will help you write less; do more. Finally, you'll learn to how write test cases using Jest and submit your application to the App Store.

React Native challenges the status quo of native iOS and Android development with revolutionary components, asynchronous execution, unique methods for touch handling, and much more. This book reveals the the path-breaking concepts of React.js and acquaints you with the React way of thinking so you can learn to create stunning user interfaces.

What You'll Learn

Build stunning iOS and Android applications

Understand the Redux design pattern and use it in your project

Interact with iOS and android device capabilities such as addressbook, camera, GPS and more with your apps

Test and launch your application to the App StoreWho This Book Is For

Anyone with JavaScript experience who wants to build native mobile applications but dreads the thought of programming in Objective-C or Java. Developers who have experience with JavaScript but are new or not acquainted to React Native or ReactJS.

Table of Contents

Frontmatter

Chapter 1. Learning the Basics: A Whistle-Stop Tour of React

Abstract
Before you embark on your React Native journey, you must know a little bit about React (also known as ReactJS or React.js). In this chapter, we quickly look at the core concepts of React, which will help you to work on React Native. This chapter introduces the following topics:
Akshat Paul, Abhishek Nalwaya

Chapter 2. The Simplest Program: Hello World with React Native

Abstract
In the last chapter, you got a good overview of the React ecosystem. Now it’s time to get your hands dirty with React Native. In this chapter, you will set up your development environment by installing the prerequisites and then you will create your first React Native application.
Akshat Paul, Abhishek Nalwaya

Chapter 3. Solving Problems Differently with Flux and Redux

Abstract
Flux is an application architecture introduced by Facebook for building client-side applications. It complements the React paradigm of composable view components by using a unidirectional data flow. It's more of a pattern than a framework, and one can start using Flux immediately without an excess load of code. Redux is a predictable state container for JavaScript applications, which means it helps us to write applications that behave consistently in different environments: client, server, or native. It also makes your applications easy to debug and test.
Akshat Paul, Abhishek Nalwaya

Chapter 4. Canvas, Brush, and Paint: Working with the User Interface

Abstract
Chapter 3 introduced React Native state management using Flux and Redux, and you created your first React Native application. Now that you have a skeleton for your project, let’s fill it out with a stunning UI. This chapter covers the following topics:
Akshat Paul, Abhishek Nalwaya

Chapter 5. Exploring Device Capabilities

Abstract
Mobile devices are not just limited to making phone calls; they are some of the most advanced pieces of consumer technology ever invented. Their real power lies in the various capabilities that reside in a smartphone. The iOS and Android platforms allow us to use various device features to make a more captivating application experience for our users. This chapter explores the following device capabilities:
Akshat Paul, Abhishek Nalwaya

Chapter 6. Communicating with Servers

Abstract
After learning about the powers of device capabilities with many examples, it’s time to get back to our SmartHouse application. So far, you have been populating your app locally with some dummy data, but no application can survive without communicating with a server. This chapter covers how to interact with network APIs. You will explore the following topics:
Akshat Paul, Abhishek Nalwaya

Chapter 7. Native Bridging in React Native

Abstract
So far, you have learned how to build applications using modules and APIs available out of the box with React Native. There are times, however, when an application has to access a native iOS or Android API and its corresponding React Native module is not yet available. Perhaps you will have to reuse some existing bespoke Swift, Kotlin, or Objective-C code with your React Native application. In such scenarios we create something called Native modules, which allow us to write code in the native language of a platform. This chapter covers the following topics:
Akshat Paul, Abhishek Nalwaya

Chapter 8. Testing

Abstract
We do agree with Kent Beck here that testing your code is your responsibility. However, React Native makes it really simple to write tests for your application in comparison to traditional native code for iOS and Android. This chapter covers the following topics:
Akshat Paul, Abhishek Nalwaya

Chapter 9. Getting Ready for the World

Abstract
That’s a strong quote, but it usually proves quite right. However, when it comes to launching our application with React Native, it is a piece of cake. This chapter covers how you can create a build to distribute your React Native application for both iOS and Android. We also introduce some third-party platforms that are available to make distribution totally stress free. Here are the topics covered in this chapter:
Akshat Paul, Abhishek Nalwaya

Chapter 10. The Ecosystem: Extending React Native

Abstract
If you have come this far, you can proudly say you have become a React Native developer. In this final chapter you learn how expedite your React Native development by using some very useful, stable, and popular libraries. These are designed to make your life a bit easier and help you create your apps faster. This chapter covers the following topics:
Akshat Paul, Abhishek Nalwaya

Backmatter

Additional information

Premium Partner

    Image Credits