Skip to content

Modern React modernization

Modernization is a sequence of verified boundaries, not a rewrite checkbox.

Priorities

  1. Move to strict TypeScript and a supported toolchain.
  2. Replace class lifecycle coupling with cohesive components and explicit effects.
  3. Move state to its narrowest owner; introduce reducers for related transitions.
  4. Route and split code by user workflow.
  5. Replace implementation tests with behavior-focused tests.
  6. Profile before adding memoization.

Migration traps

  • Translating lifecycle methods one-for-one into effects.
  • Storing values that can be derived during render.
  • Putting all state into one global Context.
  • Treating concurrent rendering as an ordering guarantee.
  • Migrating build tools without validating production base paths and caching.

Use characterization tests and small vertical slices to preserve observable behavior while changing internals.