Table of Contents

Preface: A Note of Warning

What you’re about to read may cause involuntary eye-rolling, heavy sighing, and occasional laughter

Introduction: Why You’re Reading This (And Why You Hate React)

The truth about why you’re here and what we’re going to do about it


Part I: The Bitter Pill

Understanding the medicine you’re about to take

Chapter 1: The Problem React Claims to Solve (That Wasn’t Really a Problem)

  • The “jQuery Spaghetti” Myth
  • Two-Way Data Binding: The Devil We Knew
  • Facebook’s First World Problems
  • When Simple Became Complex

Chapter 2: JavaScript Fatigue: How We Got Here

  • The Great Framework Wars of 2010-2020
  • NPM: The Package Manager That Ate the World
  • Build Tools: A Love Story Gone Wrong
  • The Day HTML Stopped Being Enough

Chapter 3: The Virtual DOM: A Beautiful Lie

  • What the Virtual DOM Actually Is
  • The Performance Promise That Wasn’t
  • Reconciliation: Making Simple Things Complicated
  • Why Direct DOM Manipulation Became “Bad”

Chapter 4: JSX: When HTML and JavaScript Had a Baby Nobody Asked For

  • XML in JavaScript: What Could Go Wrong?
  • The Transpilation Tax
  • Why className and htmlFor Exist
  • Conditional Rendering: Ternary Operators Everywhere

Part II: Swallowing the Medicine

Learning React while maintaining your sanity

Chapter 5: Components: Everything is a Nail When You Have a Hammer

  • The Component All The Things Philosophy
  • Functional vs Class: The Civil War
  • When a Div Would Have Been Fine
  • Props: Passing Problems Down the Tree

Chapter 6: State Management: Choose Your Own Adventure in Hell

  • Local State: The Gateway Drug
  • Lifting State Up: Musical Chairs with Data
  • Context API: Prop Drilling’s Complicated Brother
  • Redux: When You Need a Library to Manage a Library

Chapter 7: Hooks: The Magic That Makes You Miss Classes

  • useState: Because Functions Need Memory Too
  • The Rules of Hooks: Arbitrary but Mandatory
  • Custom Hooks: Abstracting Your Abstractions
  • Why Everything Starts with “use”

Chapter 8: useEffect: The Footgun You’ll Shoot Yourself With

  • ComponentDidMount’s Evil Twin
  • The Dependency Array of Doom
  • Cleanup Functions: Forgetting Them Since 2019
  • Infinite Loops and How to Love Them

Chapter 9: Props Drilling: Pass It Down, Pass It Down, Pass It Down…

  • The Christmas Tree of Props
  • When Your Component Needs Its Grandparent’s Data
  • Context to the Rescue (Sort Of)
  • Why Global Variables Suddenly Look Appealing

Part III: Making Peace

Finding the balance between React’s way and sanity

Chapter 10: Patterns and Anti-Patterns: The Good, The Bad, The React

  • Container/Presentational: Separation That Isn’t
  • Higher-Order Components: Inception for Code
  • Render Props: Functions Returning Functions Returning JSX
  • Compound Components: When Simple Gets Complicated

Chapter 11: Performance: When React is Actually Fast (Sometimes)

  • The Myths of React Performance
  • React.memo: Memoizing Your Mistakes
  • useMemo and useCallback: Premature Optimization Central
  • When Re-renders Actually Matter

Chapter 12: Testing React: Because Your Components Need Therapy Too

  • Unit Testing Components: Mocking the Universe
  • React Testing Library: Not Testing Implementation Details (Allegedly)
  • Snapshot Testing: The Lie Detector That Lies
  • E2E Testing: When You’ve Given Up on Unit Tests

Chapter 13: The Ecosystem: 47 Ways to Build the Same Thing

  • Create React App vs Next.js vs Gatsby vs Vite vs…
  • CSS-in-JS: Because Regular CSS Wasn’t Complicated Enough
  • Form Libraries: Solving Problems You Didn’t Know You Had
  • The NPM Audit Security Theater

Part IV: Stockholm Syndrome

Learning to love your captor

Chapter 14: Building Something Real: A Todo App (Of Course)

  • The Rite of Passage
  • Over-Engineering a Simple List
  • Adding Features Nobody Asked For
  • Deploying Your Masterpiece of Complexity

Chapter 15: The Grass Isn’t Always Greener: Vue, Svelte, and Why You’ll Be Back

  • Vue: The Middle Child
  • Svelte: The New Kid Who Gets It
  • Solid: React Without the Baggage
  • Why You’ll End Up Using React Anyway

Chapter 16: Acceptance: Making React Work for You (Not the Other Way Around)

  • Choosing Your Battles
  • The Features That Actually Help
  • Building Your Own Conventions
  • Finding Peace in the Chaos

Conclusion: You’ve Learned React. I’m Sorry.

What you’ve accomplished and what it cost you

Appendix: Resources for Recovery

  • Documentation That Actually Helps
  • Communities of Fellow Sufferers
  • Tools to Make React Bearable
  • Career Alternatives (Just Kidding… Or Am I?)

About the Author

A developer who has seen too much and lived to tell the tale

Acknowledgments

To all the developers who’ve shared in this journey through the valley of tears