Book description
Dive in and discover how to build awesome React web apps that you can scale and maintain using design patterns and the latest industry insights Purchase of the print or Kindle book includes a free PDF eBook
Key Features
- Discover and unpack the latest React 18 and Node 19 features in this updated fourth edition
- Get up to speed with TypeScript, MonoRepo architecture, and several cutting-edge React tools
- Learn from plenty of real-world examples and an improved chapter flow
Book Description
React helps you work smarter, not harder — but to reap the benefits of this popular JavaScript library and its components, you need a straightforward guide that will teach you how to make the most of it.
React 18 Design Patterns and Best Practices will help you use React effectively to make your applications more flexible, easier to maintain, and improve their performance, while giving your workflow a huge boost. With a better organization of topics and knowledge about best practices added to your developer toolbox, the updated fourth edition ensures an enhanced learning experience.
The book is split into three parts; the first will teach you the fundamentals of React patterns, the second will dive into how React works, and the third will focus on real-world applications. All the code samples are updated to the latest version of React and you’ll also find plenty of new additions that explore React 18 and Node 19’s newest features, alongside MonoRepo Architecture and a dedicated chapter on TypeScript.
By the end of this book, you'll be able to efficiently build and deploy real-world React web applications.
What you will learn
- Get familiar with the new React 18 and Node 19 features
- Explore TypeScript's basic and advanced capabilities
- Make components communicate with each other by applying various patterns and techniques
- Dive into MonoRepo architecture
- Use server-side rendering to make applications load faster
- Write a comprehensive set of tests to create robust and maintainable code
- Build high-performing applications by styling and optimizing React components
Who this book is for
This book is for web developers who want to master React by learning key design patterns and best practices in real-world application development. You’ll need an intermediate-level experience with React and JavaScript before you get started.
Table of contents
- Preface
- Taking Your First Steps with React
- Introducing TypeScript
- Cleaning Up Your Code
- Exploring Popular Composition Patterns
- Writing Code for the Browser
- Making Your Components Look Beautiful
- Anti-Patterns to Be Avoided
- React Hooks
- React Router
- React 18 New Features
- Managing Data
- Server-Side Rendering
-
Understanding GraphQL with a Real Project
- Technical requirements
- Building a backend login system using PostgreSQL, Apollo Server, GraphQL, Sequelize, and JSON Web Tokens
- Installing PostgreSQL
- Creating our backend project
- Configuring Apollo Server
- Defining our GraphQL types, queries, and mutations
- Creating our resolvers
- Using the Sequelize ORM
- Authentication functions
- Running our project for the first time
-
Building a frontend login system with Apollo Client
- Configuring Webpack 5
- Configuring our TypeScript
- Configuring the Express server
- Creating our frontend configuration
- Creating the user middleware
- Creating JWT functions
- Creating our GraphQL queries and mutations
- Creating user context to handle login and connected user
- Configuring Apollo Client
- Creating our app routes
- Creating our pages
- Creating our login components
- Creating our dashboard components
- Testing our login system
- Summary
-
MonoRepo Architecture
- Technical requirements
- Advantages of a monorepository and the problems it solves
- Creating a MonoRepo with NPM Workspaces
- Implementing TypeScript in our MonoRepo
- Creating a devtools package to compile packages with Webpack
- Creating the utils package
-
Creating the API package
- Creating a user-shared model
- Creating a user-shared GraphQL type and resolver
- Creating custom services
- Building our service configuration
- Creating our custom models
- Creating model seeds
- Creating our custom GraphQL types and resolvers
- Synchronizing our models and starting Apollo Server
- Testing our CRM service
- Creating the frontend package
- Summary
- Improving the Performance of Your Applications
- Testing and Debugging
- Deploying to Production
- Other Books You May Enjoy
- Index
Product information
- Title: React 18 Design Patterns and Best Practices, 4e - Fourth Edition
- Author(s):
- Release date: July 2023
- Publisher(s): Packt Publishing
- ISBN: 9781803233109
You might also like
book
React 17 Design Patterns and Best Practices - Third Edition
Build scalable, maintainable, and powerful React web apps with design patterns and insightful best practices Key …
book
JavaScript: The Definitive Guide, 7th Edition
JavaScript is the programming language of the web and is used by more software developers today …
video
Modern JavaScript from the Beginning - Second Edition
This course is a comprehensive introduction to JavaScript, covering everything from the basics of variables, data …
book
Learning JavaScript Design Patterns, 2nd Edition
Do you want to write beautiful, structured, and maintainable JavaScript by applying modern design patterns to …