Book Image

React 18 Design Patterns and Best Practices - Fourth Edition

By : Carlos Santana Roldán
4.2 (6)
Book Image

React 18 Design Patterns and Best Practices - Fourth Edition

4.2 (6)
By: Carlos Santana Roldán

Overview of this book

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.
Table of Contents (20 chapters)
18
Other Books You May Enjoy
19
Index

Cleaning Up Your Code

This chapter assumes that you have prior experience with JSX (JavaScript XML) and are interested in improving your skills to use it effectively. To use JSX/TSX without any issues or unexpected behavior, it’s crucial to understand how it works under the hood and the reasons why it’s a useful tool for building UIs.

Our objective is to write clean JSX/TSX code, maintain it, and have a good understanding of its inner workings, including how it’s translated to JavaScript and the features it provides.

By understanding the intricacies of JSX/TSX, you can leverage its full potential to build efficient and scalable UIs. We will explore various tips and techniques to help you write better code and avoid common mistakes. By the end of this chapter, you will have a solid grasp of how JSX/TSX works and how to use it effectively in your React applications.

In this chapter, we will cover the following topics:

  • What is JSX and why...