Book Image

React Design Patterns and Best Practices

By : Michele Bertoli
Book Image

React Design Patterns and Best Practices

By: Michele Bertoli

Overview of this book

Taking a complete journey through the most valuable design patterns in React, this book demonstrates how to apply design patterns and best practices in real-life situations, whether that’s for new or already existing projects. It will help you to make your applications more flexible, perform better, and easier to maintain – giving your workflow a huge boost when it comes to speed without reducing quality. We’ll begin by understanding the internals of React before gradually moving on to writing clean and maintainable code. We’ll build components that are reusable across the application, structure applications, and create forms that actually work. Then we’ll style React components and optimize them to make applications faster and more responsive. Finally, we’ll write tests effectively and you’ll learn how to contribute to React and its ecosystem. By the end of the book, you’ll be saved from a lot of trial and error and developmental headaches, and you will be on the road to becoming a React expert.
Table of Contents (19 chapters)
React Design Patterns and Best Practices
Credits
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface

Reasons to implement Server-Side Rendering


SSR is a great feature, but we should not jump into it just for the sake of it: we should have a real and solid reason to start using it. In this section, we will look at how server-side rendering can help our application and which problems it can solve for us.

SEO

One of the main reasons we may want to render our applications on the server-side is Search Engine Optimization (SEO).

In fact, if we serve an empty HTML skeleton to the crawlers of the main search engines, they are not able to extract any meaningful information from it.

Nowadays, Google seems to be able to run JavaScript, but there are some limitations, and SEO is often a critical aspect of our businesses.

For years, we used to write two applications: a server-side rendered one for the crawlers and another one to be used on the client side by the users.

We used to do that because server-side rendered applications could not give us the level of interactivity users expect, while a client-side...