Systems | Development | Analytics | API | Testing

March 2020

Replacing Recompose with React Hooks

Recompose is a React utility belt for function components and higher-order components that has been very useful to our frontend engineering team. After more than three years of working with it, we’ve identified a lot of pain points. In October 2018, the React team introduced Hooks which shipped with React v16.8 and provided an alternative to HOCs.

How to remove Recompose and replace with Hooks

In our last post, we explored the pros and cons of Recompose and why we decided to remove it from our codebase. This post includes the strategy we used to approach the large task of implementing that refactor. It’s important to note that this strategy was created to fit our specific situation and is not a one size fits all approach to removing Recompose. Specifically, it was intended to work with our large codebase that is modified by our devs daily.