Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying React Anti-Patterns
  • Table Of Contents Toc
  • Feedback & Rating feedback
React Anti-Patterns

React Anti-Patterns

By : Juntao Qiu
4.8 (10)
close
close
React Anti-Patterns

React Anti-Patterns

4.8 (10)
By: Juntao Qiu

Overview of this book

Take your React development skills to the next level by examining common anti-patterns with expert insights and practical solutions, to refine your codebases into sophisticated and scalable creations. Through this easy-to-follow guide, React Anti-Patterns serves as a roadmap to elevating the efficiency and maintainability of your React projects. You’ll begin by familiarizing yourself with the essential aspects of React before exploring strategies for structuring React applications and creating well-organized, modular, and easy-to-maintain codebases. From identifying and addressing common anti-patterns using refactoring techniques to harnessing the power of test-driven development (TDD), you’ll learn about the tools and techniques necessary to create reliable and robust tests. As you advance, you’ll get to grips with business logic and design patterns that offer solutions to prevalent challenges faced in React development. The book also offers insights into using composition patterns, such as code splitting and multiple entry points, to enhance the flexibility and modularity of your React applications, guiding you through end-to-end project implementation. By the end of this React book, you’ll be able to overcome common challenges and pitfalls to transform your React projects into elegant, efficient, and maintainable codebases.
Table of Contents (20 chapters)
close
close
Free Chapter
1
Part 1:Introducing the Fundamentals
6
Part 2: Embracing Testing Techniques
10
Part 3: Unveiling Business Logic and Design Patterns
14
Part 4: Engaging in Practical Implementation

What this book covers

In Chapter 1, Introducing React Anti-Patterns, you’ll get a closer look at the hurdles of building user interfaces, handling state management, addressing “unhappy paths,” and identifying common anti-patterns in React.

In Chapter 2, Understanding React Essentials, you will delve into the basics of React covering static components, props, UI breakdown, state management, the rendering process, and common React Hooks to lay a solid foundation for subsequent chapters.

In Chapter 3, Organizing Your React Application, you will learn about different types of project structures in React, exploring their advantages, drawbacks, and practical applications.

In Chapter 4, Designing your React Components, you will learn to identify common anti-patterns in React component design and explore fundamental design principles including the Single Responsibility Principle and Don’t Repeat Yourself to improve component structure.

In Chapter 5, Testing in React, you will learn about the significance of software testing, explore various types of tests such as unit, integration, and end-to-end testing, and get acquainted with popular testing tools including Cypress and Jest, setting a strong foundation for complex testing scenarios in React applications.

In Chapter 6, Exploring Common Refactoring Techniques, you will learn about the essence of refactoring and delve into various refactoring techniques, such as Rename Variable, Extract Variable, and Replace Loop with Pipeline, to enhance code maintainability and readability.

In Chapter 7, Introducing Test-Driven Development with React, you’ll learn the core principles of test-driven development through a practical example, while building various features of a pizza store’s menu page in a React application.

In Chapter 8, Exploring Data Management in React, you’ll delve into the common challenges of state management in React, such as business logic leaks and prop drilling, and explore solutions including employing an Anti-Corruption Layer and utilizing the React context API to enhance code maintainability and user experience.

In Chapter 9, Applying Design Principles in React, you’ll revisit the Single Responsibility Principle, embrace the Dependency Inversion Principle, and understand the application of Command and Query Responsibility Segregation in React to fortify your knowledge of key design principles to aid you in mastering React.

In Chapter 10, Diving Deep into Composition Patterns, you’ll delve into composition through higher-order components and custom Hooks, and explore the headless component pattern. You’ll gain an appreciation of composition techniques for creating scalable, maintainable, and user-friendly UIs in React.

In Chapter 11, Introducing Layered Architecture in React, you’ll explore Layered Architecture, delve into Application Concern Layers, define data models, and learn strategy patterns through a practical example, understanding their significance for large-scale applications.

In Chapter 12, Implementing an End-To-End Project, you’ll traverse the complete process of developing a weather application, from understanding requirements to implementing features such as City Search and Add To Favourite, while ensuring the code remains maintainable, understandable, and extensible.

In Chapter 13, Recapping Anti-Pattern Principles, we’ll take a concise look back at common anti-patterns, React design patterns, and fundamental principles, and recap the techniques and practices discussed earlier in the book, providing a succinct refresher before you continue applying these insights to your own projects.

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech
bookmark search playlist download font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY