2nd edition · React 19, Server Components and the Compiler

The Conscious React

AI can write the component. It can't decide where the state lives.

This book covers the decisions AI can't make for you, such as where state lives, where the server boundary goes and what to test. Its 100+ production tips show the code to avoid, the code to prefer and why.

PDF, EPUB and MOBI, with lifetime updates and a 30-day money-back guarantee.

  • 100+ tips
  • 6 chapters
  • 4 companion repos

By Petar Ivanov, software engineer and author. 30K+ engineers read The T-Shaped Dev.

The Conscious React, 2nd edition 2026, book cover

The problems

You know React. The codebase still fights you.

1

Every design tweak adds another prop, and the component fills with conditionals.

Fixed in chapter 2, Component design.
Before
<Modal title="Confirm" showHeader  showFooter confirmText="OK"  cancelText="Cancel" onConfirm={ok}  onCancel={cancel} isWide hideClose />
After
<Modal>  <Modal.Header>Confirm</Modal.Header>  <Modal.Footer>{actions}</Modal.Footer></Modal>
2

The components/ folder holds everything, and nobody can say where new state belongs.

Fixed in chapter 1, Application structure.

Folders holding cart code 3

3

You wrap things in useMemo and still can't say whether it helped.

Fixed in chapter 3, Performance.
Before
const rows = useMemo(() => format(items), [items]);const onPick = useCallback((id) => pick(id), []);const style = useMemo(() => ({ gap: 8 }), []);const total = useMemo(() => sum(rows), [rows]);
After

Why now

66%

of developers named "AI solutions that are almost right, but not quite" as a frustration. Stack Overflow 2025 survey

A coding agent copies the patterns already in your codebase, so good structure gets repeated, and so does the shortcut someone took last year. In Stack Overflow's 2025 survey, 66% of developers named "AI solutions that are almost right, but not quite" as a frustration, the most common one. Reviewing that code is now the job, and this book trains the judgment it takes.

★★★★★

"By following the best practices mentioned, I now better know how to transform my code from being bloated, unoptimised and messy to being organised, structured and more easily scalable. And thanks to the included explanations I can understand the "why" part of the learning process."

Oliver RichardsonJunior Software Engineer

A real sample

One tip from the book

Every tip uses the same format: Context, Avoid, Prefer, Takeaway.

Table of contents

What's inside, and what each chapter fixes

01Application structure and architecture

The problem it solves

The codebase gets harder to change with every feature, and nobody agrees where state or the server boundary goes

Example tips

  • 1.1 Put components into folders that scale
  • 1.2 Group by domain, not by technical role
  • 1.3 Prefer absolute import paths
02Component design

The problem it solves

Components that grow a prop per design tweak and break when reused

Example tips

  • 2.23 Choose composition over configuration
03Performance

The problem it solves

Memoizing by habit, and slow pages nobody has measured

Example tips

  • Profile, measure, then optimize, with the React Compiler and Server Components
04Testing

The problem it solves

Tests that break on every refactor, or no tests at all

Example tips

  • A five-layer testing setup with Vitest, MSW v2 and Playwright
05Tooling

The problem it solves

Slow linting and inconsistent formatting across the team

Example tips

  • The 2026 stack: Oxlint, Oxfmt, pnpm, Turbopack
06Conclusion

The problem it solves

Knowing what to apply first on your own codebase

  • 100+tips
  • 6chapters
  • ~200pages
  • 4companion repos

Try before you buy

Read three tips from chapter 1, free

Three real tips from the book, in the same format as the one above. If the way it thinks clicks for you, you'll know in ten minutes.

  • 1.1Put components into folders that scale(before the codebase decides for you)
  • 1.2Group by domain, not by technical role(the reason your components/ folder rots)
  • 1.3Prefer absolute import paths(and what ../../.. chains say about your boundaries)

They look basic, and that's the point. Chapter 1 is where most React codebases go wrong before anyone writes a component.

Proof

What readers say about The Conscious React

★★★★★

"It is a fantastic and easy read with simple to follow guidelines illustrated with examples. The book has been really beneficial and practical for me from day one."

Ivan LebanovHead Of Frontend Development
★★★★★

"Petar's book is excellent for React developers at all skill levels and deserves a spot on every React shop's shelf. Each page offers short, simple, and applicable advice."

Ákos KőművesSenior Software Engineer
★★★★★

"As a React beginner, this is a great book to guide my choices when developing applications. It is clear, compact and easy to reference whenever needed."

Martin GeorgievML Engineer · PhD, University of Oxford
★★★★★

"As someone who recently started working with React this book helps me a lot with best-practices approaches and guidance."

Martin KiriloffSoftware Engineer · IT Consultant
★★★★★

"Easy, simple, practical tips, and to the point! I totally recommend!"

Shubham SoniFrontend Engineer
★★★★★

"The book has very valuable practical tips and insights. I totally recommend!"

Ivan IvanovChief Technical Officer

Pricing

Read it this weekend. Ship differently on Monday.

The book, the book with every companion repo, or both Complete Packages for React and Node. Lifetime updates on all three.

Book
$29
  • The ~200-page 2nd edition in PDF, MOBI and EPUB
  • 100+ production tips across 6 chapters
  • React 19, Server Components and Compiler-era coverage
  • Lifetime updates as React keeps changing

30-day money-back guarantee · Lifetime updates

Payment runs through Stripe, and local taxes are not included.

30-day money-back guarantee

Use it on your real codebase for 30 days. If it hasn't changed how you write React, reply to your receipt for a full refund. Keep the files.

Buying means you agree to the Terms. Your data: Privacy Policy.

FAQ

Questions

For anything else, write to info@petarivanov.tech.

Is this book a good fit for me?

It's for developers who have built an app or two with React and want to build the next one better. Brand new to React? Give it a few months first.

Do I still need this book if AI writes most of my code?

If you review that code, yes. Coding agents copy the patterns already in your codebase, so the patterns need to be worth copying, and you need to spot the ones that aren't. The book covers the decisions an agent won't make for you, such as where state lives, where the client and server boundary goes, and what to test.

What's new in the 2nd edition?

It's a full rewrite for React 19, Server Components, the React Compiler, modern testing (Vitest, MSW v2, Playwright) and modern tooling (Oxlint, Oxfmt, pnpm, Turbopack). It has 100+ tips, with new sections on Server Component mental models, refs as props, forms with actions and hydration mismatches.

What format are the files?

The book ships as PDF, MOBI and EPUB. The Complete Package adds access to four GitHub repos (book-examples, case-studies, react-boilerplate and nextjs-boilerplate).

Can I get an invoice for my company?

Stripe emails you a receipt right after checkout. Reply to the purchase email for an invoice with your company details, and I'll send one.

Is there a print edition?

Not yet. The book is digital only for now.

The author

What engineers say about my writing

★★★★★

"Many newsletters in the dev space share tutorials, but Petar shares high-quality, next-level content. If you want to learn something really valuable, he’s your man. Recommended!"

Csaba KissiEntrepreneur · 256K followers on Xrecommends The T-Shaped Dev
★★★★★

"Great newsletter to help you level up as an engineer! Petar shares very practical insights in a very detailed and understandable way."

Gregor OjstersekAuthor of Engineering Leadership · 205K+ newsletter subscribersrecommends The T-Shaped Dev
★★★★★

"Petar teaches you the most important concepts you need to know in a practical, easy-to-understand way. I highly recommend subscribing"

Jordan CutlerAuthor of High Growth Engineer · 99K+ newsletter subscribersrecommends The T-Shaped Dev

The Conscious React

Your next React decision, made with a reason

Read it this weekend, and ship React that survives growth, scale and change.

Get the book, from $29

Not sure yet? Read 3 free tips

The Conscious React book cover