Video by Sonny Sangha · streamed from YouTube. All rights remain with the creator.
Lesson 5: A React Native Ride App with Redux and Google Places
About this lesson
This live build from Sonny Sangha creates a ride-hailing and delivery-style app for both iOS and Android with React Native, using Redux for shared state, TypeScript and Google's location services. After a showcase of the finished app and an explanation of how it will be built, the session sets up Expo and initialises the project, then sets up Redux so that information such as the start and end of a trip can be shared between screens. It builds the home screen and a component offering the app's main options, then implements React Native navigation to move between screens. A key step is adding a Google places autocomplete library, so that riders can search for locations as they type. The session then builds the map screen and a map component that shows the trip, followed by cards for choosing a destination and choosing a ride, each built in two stages. The directions service is used to draw the route between the two points, and a favourites component offers saved destinations. A keyboard-avoiding view keeps the inputs visible when the on-screen keyboard opens. The final part implements the travel time calculation using the journey information from Google, and then a price calculation for each ride option based on that travel time, before adding a menu button, fixing a few bugs and showing a demonstration of the finished build. As a live session, it also shows how problems are diagnosed and solved in real time. Afterwards, read Chapter 5 of the course book, which works through travel time and ride prices by hand.