Angular to React translation
For Angular developers moving to React: signals vs state, change detection vs re-rendering, dependency injection vs context, and RxJS vs query caches.
4 lessons
Reactivity
- 1Signals and computed vs useState and derived valuesAngular reruns only what read the changed signal, when read; React re-runs the component and derives values during render, so computed() becomes plain code.
- 2Change detection and OnPush vs re-rendering and memoAngular checks views in place when notified; React re-runs components below an update. Both skip unchanged inputs, but only Angular's events reach parents.
Architecture
- 3Dependency injection vs context and modulesAngular's injector creates and scopes instances; React has none: a module for the app, a provider per subtree, a store for changing state.
- 4RxJS streams vs query caches and effectsRequest-shaped pipelines become a debounced query key with a passed-on signal; event-shaped pipelines stay in RxJS, subscribed once from an effect.