AI summary by TwinMind
React just got WAY cooler
Theo - t3․gg
44m 48s
React View Transitions & Activity Features
- React experimental branch now has view transitions and activity components
- View transitions enable browser-native animations between DOM states
- Wrap elements in
<ViewTransition>component with optional name identifier - Triggers via
startTransition,deferred, orsuspense - Uses browser's view transition API for smooth crossfades and shared element animations
- Works in Chrome/Safari, not Firefox
- Simple CSS customization through view-transition pseudo-selectors
- Wrap elements in
- Activity component for hiding/showing UI parts
mode="hidden"preserves state while unmounting component- Reduces performance costs vs CSS hiding or unmounting
- Effects don't run when hidden, but state persists
- Cleanup functions still execute when switching to hidden
- Enables pre-rendering, persistent filters, cached content
- SSR optimization: hidden activities excluded from initial SSR response
Shared Element Transitions
- Elements with same view transition name animate between states
- Automatic unique name generation by React
- Transition types for different animation directions (forward/back navigation)
- CSS targeting via
::view-transition-old()and::view-transition-new() - Suspense boundary animations with fallback/content transitions
- List reordering animations using deferred values
Performance & Developer Tools
- Custom performance tracks in browser profilers
- React team collaborating with Chrome team on performance tab improvements
- New experimental LSP-based React IDE extension powered by compiler
- Shows compiler optimizations with dollar sign variables
- Improved ESLint rules and diagnostics
- Code lens for automatic effect dependencies
- Hover info for component/hook optimization status
Automatic Effect Dependencies
- React compiler can auto-insert effect dependencies
- Eliminates need to manually write dependency arrays
- New
useEventEffecthook for stable function references - Shifts mental model from component lifecycle to data synchronization
- Reduces confusion around effect timing and dependencies
React Compiler Progress
- Now in RC (Release Candidate) status
- Used extensively at Meta/Facebook
- Stable version coming in coming months
- Integrates with IDE tooling for better development experience
Future Research Areas
- Fragment refs for managing multiple DOM elements
- Gesture animations for continuous interactions (swiping, scrolling)
- Challenge: React's before/after model vs continuous gesture tracking
- Inverted old/new state model needed for interactive gestures
- Concurrent stores via new
useAPI- Replacement for
useSyncExternalStore - Full concurrent rendering support without forcing sync renders
- Will fix compatibility issues with suspense and transitions
- Replacement for
Activity Component Use Cases
- Persistent form state across navigation
- Pre-rendering routes for instant navigation
- Background data fetching without blocking UI
- Modal overlays with deprioritized background content
- Memory management with automatic state cleanup for hidden activities
Browser Compatibility & Standards
- Heavy reliance on browser standards vs custom React animation systems
- View transitions work in Chrome/Safari, Firefox support pending
- CSS-based animation customization maintains web standards approach
