Skip to content
{D:S} DMITRYSHEIKO
Blog Books About me

Refactoring Legacy React Code: Moving from OOP to Functional Components

Software Design React February 17, 2025
Refactoring Legacy React Code: Moving from OOP to Functional Components

When React Hooks arrived in 2019, migrating a large class-based codebase to functional components looked impractical. A few tricks made it workable: composition instead of inheritance, useImperativeHandle for imperative APIs, and function-based customization in place of subclassing.

GitHub Discussions
comments
Facebook LinkedIn icon X Reddit

Labels

AI (2) API Integration (2) Clean Code (4) CMS (6) CSS (3) Design Patterns (3) Developer Tools (8) JavaScript (19) PHP (4) React (5) RWD (3) Software Architecture (2) Software Design (15) Testing & QA (8) Thoughts & Opinions (12) Web Standards (13)

My github

Puppetry

puppetry

Web testing solution for non-developers on top of Puppeteer and Jest

sitecheckup

A command-line tool for checking the integrity of a deployed website

design-patterns-for-web-developer

A collection of design patterns tailored for web developers

bycontract

Argument validation library based on JSDOC syntax

boilerplate

A collection of 20 frontend and full-stack starter templates covering React, Vue, Svelte, SolidJS, Webpack, Vite, Rspack, TypeScript, and more

extras

Type manipulation utility-belt bringing JavaScript-like development experience to PHP

My gists

CSS Style Sync — Claude Code Skill for Legacy-vs-New Computed Style Diffing
Custom ESLint Rules: Enforcing Consistent Inner Spacing (eslint@^9)
Service-worker to prefetch remote images (with expiration) and respond with fallback one when image cannot be fetched
Example of pre-commit GIT hook for a PHP-based project

My codepens

Fancy Modal Window built with CSS only
Conditional Media Query Mixin
Controls for Youtube embedded video
Scroll top with a transition effect

Who's the dude?

Dmitry Sheiko
Dmitry Sheiko is a web-developer living and working in Frankfurt am Main, DE

Elsewhere

X Twitter LinkedIn icon LinkedIn GitHub Github CodePen Codepen SlideShare Slideshare Stack Overflow Stackoverflow

Credits

material.io/tools/icons simpleicons.org
  • Copyright © 2003–2026
  • Dmitry Sheiko
  • •
  • Contact me
  • •
  • Article RSS feed