🚫 Zero Prop Drilling
Transform 15+ props per component to clean service injection. No more manual prop passing.
// ❌ Your React components todayfunction Dashboard({ user, setUser, products, setProducts, loading, setLoading, cart, setCart, cartTotal, setCartTotal, theme, setTheme, notifications, setNotifications, permissions, preferences, onUpdate, onError, /* ...and 10+ more props */}) { // Complex useEffect chains, manual synchronization...}// ✅ Your React components with TDI2function Dashboard({ userService, productService, cartService}: { userService: Inject<UserServiceInterface>; productService: Inject<ProductServiceInterface>; cartService: Inject<CartServiceInterface>;}) { // Clean, focused, automatically synchronized return <div>{userService.state.name} has {cartService.state.items.length} items</div>;}Result: Zero prop drilling. Automatic state sync. Pure business logic separation.
npx degit 7frank/tdi2/examples/tdi2-basic-example my-di-appcd my-di-app && npm install && npm run devOpen http://localhost:5173 → Working React app with zero prop drilling!
🚫 Zero Prop Drilling
Transform 15+ props per component to clean service injection. No more manual prop passing.
⚡ Automatic State Sync
Change service state anywhere → all components update automatically. No subscriptions needed.
🔧 Build-Time Magic
TypeScript interfaces become DI tokens. Zero runtime overhead, perfect tree-shaking.
🧪 Simple Testing
Mock services, not props. Test business logic separately from UI components.
| Your React Code Today | With TDI2 |
|---|---|
| Props: 15+ props per component | Props: Zero data props |
| State Sync: Manual useEffect chains | State Sync: Automatic everywhere |
| Testing: Mock dozens of props | Testing: Mock clean service interfaces |
| Architecture: No clear boundaries | Architecture: Service → Component separation |
| Maintenance: Prop drilling nightmare | Maintenance: Change service, all components update |
Real Impact: TDI2 transforms React from “component framework with state chaos” to “service-oriented architecture with React rendering”.
Next Level: Enterprise Implementation • Framework Comparisons • Architecture Decisions
TDI2 is designed for large-scale React applications with:
Ready to transform your React application architecture?