Book Image

Mastering React Native

By : Eric Masiello, Jacob Friedmann
Book Image

Mastering React Native

By: Eric Masiello, Jacob Friedmann

Overview of this book

React Native has completely revolutionized mobile development by empowering JavaScript developers to build world-class mobile apps that run natively on mobile platforms. This book will show you how to apply JavaScript and other front-end skills to build cross-platform React Native applications for iOS and Android using a single codebase. This book will provide you with all the React Native building blocks necessary to become an expert. We’ll give you a brief explanation of the numerous native components and APIs that come bundled with React Native including Images, Views, ListViews, WebViews, and much more. You will learn to utilize form inputs in React Native. You’ll get an overview of Facebook’s Flux data architecture and then apply Redux to manage data with a remote API. You will also learn to animate different parts of your application, as well as routing using React Native’s navigation APIs. By the end of the book, you will be able to build cutting-edge applications using the React Native framework.
Table of Contents (20 chapters)
Mastering React Native
About the Authors
About the Reviewer
Customer Feedback

Chapter 1. Building a Foundation in React

There is a common trope within the frontend web development community that boils down to new day, new framework. It is a comment on the velocity at which this profession is changing and evolving. The rapid pace can be exhausting, but it is also exciting because of what it represents. The domain of frontend developers seems to be ever expanding-from simple web pages to web applications, mobile applications, and beyond-and with that, the number of smart people contributing ideas and code to the collective knowledge bank is also expanding.     

With all of that said, any sane person must pick and choose which developments to tune into. When React.js emerged on to the open source scene in May 2013 from the inner-sanctum of Facebook, it would have been easy to brush this library off as just another frontend library. That, however, would have been a mistake. It could be said that React was the most significant and influential open source development in frontend technology in recent memory. Its growth beyond the web and its application in the realm of mobile development through React Native is both a testament to its popularity and a boon to its potential utility.

React Native is a library for creating native mobile applications using familiar web technologies that is built on top of React. What this means is that in order to understand React Native, we must first explore React. In this chapter, we'll examine the fundamentals of React. First, we'll talk briefly about the circumstances that led to React being created. We'll also cover these React concepts:

  • JSX, a JavaScript/HTML hybrid that we use to describe React components

  • React components

  • Component composition

  • Component properties, or props

  • Handling events

  • Component state

  • The React component lifecycle

  • Alternate component forms


A note to the reader: this chapter focuses on React for the web, the original purpose of the library. This provides important context for the remainder of the book. If you already know React for the web, then it is probably safe to skip this chapter and proceed to Chapter 2, Saying Hello World in React Native.