Explore
Module 1 · Part 1 of 12 · Free preview

Part 1

Chapter 1: The Two Realities--–- Every mobile app you have ever loved lives a double life. On the surface, it responds to your touch, animates smoothly, and accesses your camera or location with your permission. But beneath that polished exterior, the app is torn between two completely different worlds: the world of the operating system—iOS or Android—and the world of the code that tells it what to do. Most developers spend their entire careers mastering only one of these worlds. React Native developers learn to speak both languages fluently, then build a bridge between them.This chapter is not about writing code. You will write code by the end of this chapter, but first you need to understand the fundamental problem that React Native solves, the landscape of mobile development, and why the decision you make about your development environment today will affect every line of code you write for the rest of this book.

By the time you finish reading, you will have a working React Native environment running "Hello World" on both an iPhone simulator and an Android emulator. More importantly, you will understand what is actually happening when that "Hello World" appears on the screen.The Three-Language NightmareImagine you are the CTO of a startup that needs to launch a mobile app. You have three choices, none of them good. Choice one: hire two separate engineering teams, one for iOS and one for Android. Your burn rate doubles overnight. Your feature roadmap moves at half the speed because every new screen has to be built twice. Bug fixes are never synchronized.

This is called native development, and for years it was the only way to get truly performant apps.Choice two: hire a single team to build a hybrid app using Cordova, Ionic, or Capacitor. These tools wrap a website inside a native shell. One codebase, one team, one deployment pipeline. The user, however, suffers. Hybrid apps render HTML and CSS inside a web view. Scrolling feels sticky because the web view has to repaint constantly. Animations stutter because JavaScript has to push updates through multiple layers. The camera, GPS, and other hardware features require clunky plugins that break with every OS update. Users can tell immediately they are not using a real app.Choice three: give up and build only for iOS, losing half your potential market, or only for Android, losing the other half.React Native emerged from a different observation.

Keep reading — free

Sign in with your SamEnrico account to read the whole of lesson 1.

Sign in