Intermediate React Native, v2

4 hours, 44 minutes CC
Intermediate React Native, v2

Course Description

Ship production-ready iOS and Android apps with React Native and Expo. Grok creating user onboarding, state management with Zustand, and advanced UI techniques, including full-screen modals and deep linking. Implement native features like image selection and quick actions. Package and deploy your app to stores with proper metadata, splash screens, and icons!

This course and others like it are available as part of our Frontend Masters video subscription.

Preview
Close
Get $100 Off
Get $100 Off!

Course Details

Published: September 11, 2024

Learn Straight from the Experts Who Shape the Modern Web

Your Path to Senior Developer and Beyond
  • 200+ In-depth courses
  • 18 Learning Paths
  • Industry Leading Experts
  • Live Interactive Workshops
Get Unlimited Access Now

Table of Contents

Introduction

Section Duration: 17 minutes
  • Introduction
    Kadi Kraman begins the course by sharing her extensive experience in the React community and describing the requirements and the application that will be built from scratch. The course website provides bash commands and code snippets for each exercise. At the end of each section a link to the GitHub repo is available with a code checkpoint.
  • Plantly Project Setup
    Kadi creates a new Expo Go project for the Plantly application, a plant watering reminder app. The Expo CLI scaffolds a blank TypeScript project. Workflows for testing on Android, iOS, and simulators are demonstrated.

Navigation

Section Duration: 50 minutes

Advanced UI Techniques

Section Duration: 1 hour, 29 minutes
  • Creating Custom Buttons
    Kadi creates a custom button from the Pressable component because it's more flexible than using the TouchableOpacity component. When the button is pressed, its background darkens, and it emits haptic feedback.
  • Linear Gradients
    Kadi adds a linear gradient to the onboarding screen. The imported LinearGradient component is passed properties for the start, end, and colors to include in the gradient. Since the colors toward the top of the screen are darker, a StatusBar component is added to use a light status bar style explicitly.
  • Local Images
    Kadi creates a PlantlyImage component that serves as a wrapper around the built-in Image component. The image is added to the onboarding screen along with some heading and subheading text.
  • Full-Screen Modals
    Kadi creates a full-screen modal to overlay the application when adding a new item. The modal is a top-level component. An icon button is added to the header to open the modal.
  • Creating a New Plant Form
    Kadi creates the new plant form in the full-screen modal. The form includes an input field for the plant name and the watering frequency. Tips for handling input and navigating virtual keyboards are also discussed in this lesson.
  • Storing a List of Plants
    Kadi creates a store for the list of plants. After the new plant form is submitted, the plant is added to the store, which populates the list of plants on the home page. A PlantCard component that renders plants in the list is also added to the application.
  • Selecting Photos with Expo ImagePicker
    Kadi uses the Expo ImagePicker component to allow the user to select a photo from their photo library for a plant. When a valid image is selected, it will appear at the top of the new plant form.
  • Saving Plant Data
    Kadi explains that photos selected from the device are saved in a temporary cache that does not persist. To fix this, the newly selected photo is moved to the application's storage. The Expo File System component has been added to the application to facilitate this.
  • Dynamic Routes
    Kadi introduces dynamic routes to allow users to view the details for an individual plant. The plantId is included in the route to indicate which plant has been selected. The plantId is exposed as a parameter through the useLocalSearchParams hook. The date-fns package is also added to the application for date/time formatting.

Development Builds

Section Duration: 1 hour, 21 minutes
  • Development Builds
    Kadi explains that Expo Go allows mobile developers to get up and running quickly. However, not all native device capabilities are available in Expo Go. A development build must be used to create the entire native app experience.
  • iOS & Android Development Builds
    Kadi demonstrates how to create development builds for both iOS and Android. The builds are generated into "ios" and "android" directories, respectively. The "npx expo run:ios" and "npx expo run:android" commands will package the build and deploy it to the simulator as a native application.
  • Building in the Cloud with EAS
    Kadi demonstrates how to generate iOS and Android builds using Expo Application Services (EAS). EAS is more convenient since it doesn't require the complex local tooling setup. Installable applications can be generated, signed, and distributed to testers through an array of tools and services.
  • Splash Screens & App Icons
    Kadi adds a splash screen and application icons for both Android and iOS. Expo generates all the required versions and sizes for each platform. Auto-hiding of the splash screen can also be disabled to allow the application to retrieve authentication or persisted storage data before showing the application interface.
  • Custom Fonts
    Kadi demonstrates how to install and use custom fonts. Expo provides utility packages for importing Google Fonts. The individual font files are packaged with the application. Since font naming conventions vary between iOS and Android, the Platform.select method is used to determine which font name to use in the component styling.
  • Quick Actions
    Kadi codes a "quick action" which is another native mobile application feature for adding a custom action item to the quick action menu. The quick action adds a new plant by deep-linking into the application's new plant form.
  • Deep Linking
    Kadi demonstrates deep linking, which allows users to link directly to an internal application page rather than enter through the home screen. When the destination page is part of a stack, the initialRootName property can give the back button a reference page to return to. Edge cases for viewing the incoming URL or conditional rendering the header are also discussed in this lesson.
  • Deep Linking with Parameters
    Kadi demonstrates how to handle parameters passed in a deep link URL. These parameters are similar to URL parameters in a normal web URL. Parameters can also be passed from page to page within the application.

Deployment

Section Duration: 36 minutes

Wrapping Up

Section Duration: 9 minutes
  • Wrapping Up
    Kadi wraps up the course by sharing some resources for relevant React Native libraries and tips for building mobile applications. This lesson also discusses student questions about accessibility in mobile apps and strategies for managing client apps.

Learn Straight from the Experts Who Shape the Modern Web

  • In-depth Courses
  • Industry Leading Experts
  • Learning Paths
  • Live Interactive Workshops
Get Unlimited Access Now