React Projects
eBook - ePub

React Projects

Build 12 real-world applications from scratch using React, React Native, and React 360

Roy Derks

Compartir libro
  1. 474 páginas
  2. English
  3. ePUB (apto para móviles)
  4. Disponible en iOS y Android
eBook - ePub

React Projects

Build 12 real-world applications from scratch using React, React Native, and React 360

Roy Derks

Detalles del libro
Vista previa del libro
Índice
Citas

Información del libro

Build cross-platform applications of varying complexity for the web, mobile, and VR devices using React tooling

Key Features

  • Build React applications at scale using effective React patterns and best practices
  • Explore React features such as Hooks, the Context API, and the Suspense API
  • Extend React's integration with React Native for building cross-platform mobile apps and games

Book Description

Developed by Facebook, React is a popular library for building impressive user interfaces. React extends its capabilities to the mobile platform using the React Native framework and integrates with popular web and mobile tools to build scalable applications.

React Projects is your guide to learning React development by using modern development patterns and integrating React with powerful web tools such as GraphQL, Expo, and React 360. You'll start building a real-world project right from the first chapter and get hands on with developing scalable applications as you advance to building more complex projects. Throughout the book, you'll use the latest versions of React and React Native to explore features such as Higher Order Components (HOC), Context, and Hooks on multiple platforms, which will help you build full stack web and mobile applications efficiently. Finally, you'll delve into unit testing with Jest to build test-driven apps.

By the end of this React book, you'll have developed the skills necessary to start building scalable React apps across web and mobile platforms.

What you will learn

  • Create a wide range of applications using various modern React tools and frameworks
  • Discover how React Hooks modernize state management for React apps
  • Develop progressive web applications using React components
  • Build test-driven React applications using the Jest and Enzyme frameworks
  • Understand full stack development using React, Apollo, and GraphQL
  • Perform server-side rendering using React and React Router
  • Design gestures and animations for a cross-platform game using React Native

Who this book is for

The book is for JavaScript developers who want to explore React tooling and frameworks for building cross-platform applications. Basic knowledge of web development, ECMAScript, and React will assist with understanding key concepts covered in this book.

Preguntas frecuentes

¿Cómo cancelo mi suscripción?
Simplemente, dirígete a la sección ajustes de la cuenta y haz clic en «Cancelar suscripción». Así de sencillo. Después de cancelar tu suscripción, esta permanecerá activa el tiempo restante que hayas pagado. Obtén más información aquí.
¿Cómo descargo los libros?
Por el momento, todos nuestros libros ePub adaptables a dispositivos móviles se pueden descargar a través de la aplicación. La mayor parte de nuestros PDF también se puede descargar y ya estamos trabajando para que el resto también sea descargable. Obtén más información aquí.
¿En qué se diferencian los planes de precios?
Ambos planes te permiten acceder por completo a la biblioteca y a todas las funciones de Perlego. Las únicas diferencias son el precio y el período de suscripción: con el plan anual ahorrarás en torno a un 30 % en comparación con 12 meses de un plan mensual.
¿Qué es Perlego?
Somos un servicio de suscripción de libros de texto en línea que te permite acceder a toda una biblioteca en línea por menos de lo que cuesta un libro al mes. Con más de un millón de libros sobre más de 1000 categorías, ¡tenemos todo lo que necesitas! Obtén más información aquí.
¿Perlego ofrece la función de texto a voz?
Busca el símbolo de lectura en voz alta en tu próximo libro para ver si puedes escucharlo. La herramienta de lectura en voz alta lee el texto en voz alta por ti, resaltando el texto a medida que se lee. Puedes pausarla, acelerarla y ralentizarla. Obtén más información aquí.
¿Es React Projects un PDF/ePUB en línea?
Sí, puedes acceder a React Projects de Roy Derks en formato PDF o ePUB, así como a otros libros populares de Computer Science y Web Services & APIs. Tenemos más de un millón de libros disponibles en nuestro catálogo para que explores.

Información

Año
2019
ISBN
9781789953398
Edición
1

Creating a Real-Time Messaging Application with React Native and Expo

Having a real-time connection with a server is crucial when you're developing a real-time messaging application as you want your users to receive their messages as soon as they are sent. What you might have experienced in the previous two chapters is that mobile applications are more intuitive to use than web applications. When you want users to send messages back-and-forth, this is best done by building a mobile application, which you'll do in this chapter.
In this chapter, you'll create a real-time mobile messaging application using React Native and Expo that connects with a GraphQL server. By using WebSockets, you can create real-time connections with a server for web and mobile applications and have a two-way data flow between your application and a GraphQL server. This connection can also be used for authentication by using OAuth and JWT tokens, which is what you did in the Chapter 7, Build a Full Stack E-Commerce Application with React Native and GraphQL.
The following topics will be covered in this chapter:
  • GraphQL with React Native using Apollo
  • Authentication flows in React Native
  • GraphQL subscriptions

Project overview

In this chapter, we will create a mobile messaging application build with React Native and Expo that uses a GraphQL server for authentication and to send and receive messages. Messages can be received in real-time as GraphQL subscriptions are used through a WebSocket that was created with Apollo. Users need to be logged in to send messages through the application, for which an authentication flow was built using React Navigation and AsyncStorage to store authentication details in persistent storage.
The build time is 2 hours.

Getting started

The project that we'll create in this chapter builds upon an initial version that you can find on GitHub: https://github.com/PacktPublishing/React-Projects/tree/ch10-initial. The complete source code can also be found on GitHub: https://github.com/PacktPublishing/React-Projects/tree/ch10.
You need to have the application Expo Client installed on a mobile iOS or Android device to run the project on a physical device. Alternatively, you can install either Xcode or Android Studio on your computer to run the application on a virtual device:
  • For iOS: Information on how to set up your local machine to run the iOS simulator can be found here: https://docs.expo.io/versions/v36.0.0/workflow/ios-simulator/.
  • For Android: Information on how to set up your local machine to run the emulator from Android Studio can be found here: https://docs.expo.io/versions/v36.0.0/workflow/android-studio-emulator/. There's a known issue when running the emulator, which can be prevented by ensuring that the following lines are present in your ~/.bash_profile or ~/.bash_rc file:
export ANDROID_SDK=ANDROID_SDK_LOCATION
export PATH=ANDROID_SDK_LOCATION/platform-tools:$PATH
export PATH=ANDROID_SDK_LOCATION/tools:$PATH
The value for ANDROID_SDK_LOCATION is the path to the Android SDK on your local machine and can be found by opening Andr...

Índice