Skip to main content

Large-Team React Engineering

At scale, React problems become organizational as much as technical: ownership, stable contracts, dependency direction, migration policy, review quality, and change coordination all shape the architecture.

Architecture should mirror ownership​

A feature boundary can look like:

features/
billing/
components/
hooks/
data/
tests/
types/
index.ts

The exact folder names are not the point. The point is that one domain can evolve behind a deliberate public surface.

Feature internals stay private behind an owned contract
Other teams
consume supported feature API
Feature entry point
documented exports
Feature internals
components · hooks · data · implementation

Deep imports turn implementation layout into an accidental organization-wide contract.

State ownership should follow domain ownership​

Who should own this state?
Tooltip/open state used by one componentLocal component owner
Selected billing invoiceBilling feature owner
Search filters users share/bookmarkURL + search feature
Remote customer recordsServer/cache data owner
Session/theme platform concernFocused application/platform boundary

A giant global store often becomes organizational coupling disguised as convenience.

Shared libraries need a higher contract bar​

Reuse multiplies the cost of a bad API
One-off app component
can be specialized
Shared primitive
needs stable API + ownership
Infrastructure
versioning · migration · docs · a11y · tests

Move code into a shared package because it represents a stable shared concept—not merely because two implementations currently look similar.

The design system is infrastructure​

Design system owns
tokens · semantic primitives · focus/keyboard behavior · forms · overlays · API conventions · test helpers
Product feature owns
billing workflow · permissions · checkout policy · domain state

Use generic primitives such as Dialog; keep business-specific content and workflows in domain features.

Avoid a framework inside the framework​

Every custom platform layer creates another language
React + platform
known ecosystem contracts
Company DSL/runtime/wrapper stack
new APIs · migration burden · ownership cost

Before creating a custom framework layer, ask what repeated problem it solves, why ordinary React is insufficient, what the escape hatch is, who owns it for years, and how it can be removed.

ADRs preserve why a decision exists​

Title
Status
Context
Decision
Alternatives considered
Consequences
Migration plan
Owner
Date
Architecture decisions should survive chat history
Context + constraints
why change is needed
Options + trade-offs
what was considered
Decision + consequences
what future teams inherit

Useful ADR topics include state strategy, URL conventions, RSC/client boundaries, error strategy, design-system ownership, cache/data layer, compiler rollout, and testing policy.

Let automation handle mechanical review​

Automation
format · TypeScript · ESLint · Hooks/Compiler rules · tests · CI
Human review
ownership · API misuse risk · a11y · security · failure design · coupling · migration

Human reviewers should spend attention on decisions tools cannot reliably make.

Make recurring production lessons explicit​

React PR checklist
- state owner is clear
- no unnecessary Effect-derived state
- stable domain keys
- semantic HTML/accessibility
- runtime validation at trust boundaries
- tests at the correct layer
- new shared APIs documented
- observability for critical flows
- migration notes for breaking changes

Checklists should encode repeated failure patterns, not personal style preferences.

Ownership must be discoverable​

A critical boundary needs an obvious responsible team
CODEOWNERS
review routing
Package/service metadata
technical ownership
Docs/catalog
contract + runbook
On-call
incident ownership
Maintainers
safe evolution
Migration policy
breaking-change path

Dependency direction prevents organizational cycles​

Prefer directional layers over circular team dependencies
Platform / design system
cross-cutting foundations
Shared domain libraries
stable reusable concepts
Features
domain ownership
Routes / application shell
product composition

Exact layering varies, but cycles such as Team A internals → Team B internals → Team C state → Team A helper should trigger architectural review.

Global Context can create invisible coupling​

One broad provider becomes an implicit dependency graph
Mega AppContext
user · theme · locale · billing · search · experiments · notifications
Focused providers/stores
smaller contracts + clearer update surfaces

Provider scope should be no broader than the dependency requires.

Stable APIs matter more than stable internals​

A feature may move internally from useReducer to a state machine or server cache without forcing consumers to change if its public contract remains stable.

Encapsulation lets implementation evolve
Stable public API
consumer contract
Replaceable internals
reducer → state machine → server/cache architecture

Large-team change lifecycle​

1Define owner
2Define contract
3Automate policy
4Review architecture
5Ship incrementally
6Observe + migrate

Large-team React architecture succeeds when teams can change their internals independently while shared boundaries remain understandable, testable, observable, and intentionally governed.