explaingit

acdlite/recompose

Analysis updated 2026-06-24

14,809JavaScriptAudience · developerComplexity · 2/5LicenseSetup · easy

TLDR

React utility belt of higher-order components and helpers like withState, pure, and compose, now archived in favor of React Hooks.

Mindmap

mindmap
  root((recompose))
    Inputs
      React component
      Props config
      State setup
      HOC chain
    Outputs
      Wrapped component
      Memoized render
      Stateful function
      Context provider
    Use Cases
      Add state to FC
      Optimize updates
      Compose HOCs
      Maintain legacy app
    Tech Stack
      JavaScript
      React
      Preact
      Relay
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Maintain a legacy React codebase that already uses withState, mapProps, and compose

USE CASE 2

Wrap a class component in pure to add shallowEqual update checks

USE CASE 3

Compose several small higher-order components into one wrapper with the compose helper

USE CASE 4

Study HOC patterns as a precursor to React Hooks for learning purposes

What is it built with?

JavaScriptReactPreact

How does it compare?

acdlite/recomposehapijs/hapishowdownjs/showdown
Stars14,80914,78314,854
LanguageJavaScriptJavaScriptJavaScript
Last pushed2026-01-02
MaintenanceQuiet
Setup difficultyeasyeasyeasy
Complexity2/53/51/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

The library is no longer actively developed and the author recommends React Hooks for new code.

Released under MIT, which lets you use, modify, and ship it commercially as long as you keep the license notice.

In plain English

Recompose is a JavaScript library for the React framework. The README describes it as a utility belt for function components and higher-order components, with the comparison that it does for React what lodash does for general JavaScript: a grab bag of small helpers that you reach for when you need them. The top of the README is a notice from the author. He created Recompose three years before joining the React team, and then React introduced an official feature called Hooks that addresses the same problems. He stopped active development at that point and now recommends Hooks instead. Existing code that uses Recompose will continue to work, but new features are not being added, with rare exceptions for bug fixes or compatibility patches. The README walks through the kinds of jobs Recompose was built to do. Helpers such as withState and withReducer let you attach a piece of state to a function component without writing a class. The pure and onlyUpdateForKeys helpers add the same shouldComponentUpdate optimisation that a React.PureComponent gives you, but as a wrapper rather than a class extension. Other helpers, such as componentFromProp, defaultProps, and withContext, package up common React patterns into one-liners. There is also a recompose-relay companion package for working with the Relay data framework. The central idea is higher-order components. The README explains that a higher-order component is a function that takes a React component and returns a new component with extra behaviour added on top. Recompose ships a toolkit of these wrappers and small utilities like shallowEqual, getDisplayName, and toClass that React libraries tend to reinvent. You can also build your own higher-order components by composing them together with the compose helper. The Why section explains the wider preference for function components over classes: less misuse of setState, a cleaner separation between smart and presentational components, more reusable code, and room for React to skip work internally. The README ends with installation through npm, notes that React is a peer dependency, a tip for using the library with Preact, and links to the full API docs and a performance discussion.

Copy-paste prompts

Prompt 1
Refactor a Recompose withState chain into the equivalent useState and useEffect hooks
Prompt 2
Audit a legacy React codebase and list every Recompose HOC that has a Hooks equivalent
Prompt 3
Wrap a presentational component with Recompose pure to skip unnecessary renders
Prompt 4
Build a small HOC with Recompose compose that adds logging and default props
Prompt 5
Plan a migration off Recompose for a 2026 React app and stage it module by module

Frequently asked questions

What is recompose?

React utility belt of higher-order components and helpers like withState, pure, and compose, now archived in favor of React Hooks.

What language is recompose written in?

Mainly JavaScript. The stack also includes JavaScript, React, Preact.

What license does recompose use?

Released under MIT, which lets you use, modify, and ship it commercially as long as you keep the license notice.

How hard is recompose to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is recompose for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.