This website uses cookies to ensure you get the best possible experience. See our Cookies Policy.

PMG Digital Made for Humans

The Right Level of React Abstraction

2 MINUTE READ | February 21, 2017

The Right Level of React Abstraction

Yesterday while reviewing a few pull requests from my coworkers, I was struck by how easy a few changes were in some React code. The changes were easy because the codebase in question had found the right level of abstraction in the pieces that were changing. ReactJS may be the next shiny new thing, but a surprising amount of old design advice still applies.

In this case, a <DeleteButton /> component was being used in one PR and changed in another. This was possible because the public interface of that component — how it was to be used in JSX — that interface did not change even though the underlying implementation did. My coworkers realized the value of programming to an interface

Similarly, the new implementation of <DeleteButton /> favored a lot of composition over inheritance and re-used a few existing components effectively. More old advice.

The thing we’re still learning about React and other frontend frameworks (like Vue, Angular, etc.) is how they hold up over time. How they help us imperfect developers meet the needs of our projects or employers. There are no 10-year-old react projects (yet). No one has any real, react-specific advice on how things will hold up beyond the attention span of the current frontend world.

Insights meet inbox

Sign up for weekly articles & resources.

I suspect the truth is that it doesn’t matter what flavor of frontend framework (or lack of) gets used. What matters if finding the right level of abstraction that makes changes easy over time. Following some more traditional advice — advice that has proven itself in long term projects — well, that sort of advice is worth following.


Posted by Christopher Davis

Related Content

thumbnail image

Get Informed

PMG Innovation Challenge Inspires New Alli Technology Solutions

4 MINUTES READ | November 2, 2021

Get Informed

Applying Function Options to Domain Entities in Go

11 MINUTES READ | October 21, 2019

thumbnail image

Get Informed

My Experience Teaching Through Jupyter Notebooks

4 MINUTES READ | September 21, 2019

Get Informed

Trading Symfony’s Form Component for Data Transfer Objects

8 MINUTES READ | September 3, 2019

Get Inspired

Working with an Automation Mindset

5 MINUTES READ | August 22, 2019

Get Informed

Parsing Redshift Logs to Understand Data Usage

7 MINUTES READ | May 6, 2019

Get Inspired

3 Tips for Showing Value in the Tech You Build

5 MINUTES READ | April 24, 2019

thumbnail image

Get Informed

Testing React

13 MINUTES READ | March 12, 2019

Get Inspired

Tips for Designing & Testing Software Without a UX Specialist

4 MINUTES READ | March 6, 2019

Get Informed

A Beginner’s Experience with Terraform

4 MINUTES READ | December 20, 2018

ALL POSTS