# recompose **Repository Path**: mirrors_euvl/recompose ## Basic Information - **Project Name**: recompose - **Description**: A React utility belt for function components and higher-order components. - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-09-24 - **Last Updated**: 2026-03-15 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README Recompose ----- [![build status](https://img.shields.io/travis/acdlite/recompose/master.svg?style=flat-square)](https://travis-ci.org/acdlite/recompose) [![coverage](https://img.shields.io/codecov/c/github/acdlite/recompose.svg?style=flat-square)](https://codecov.io/github/acdlite/recompose) [![code climate](https://img.shields.io/codeclimate/github/acdlite/recompose.svg?style=flat-square)](https://codeclimate.com/github/acdlite/recompose) [![npm version](https://img.shields.io/npm/v/recompose.svg?style=flat-square)](https://www.npmjs.com/package/recompose) [![npm downloads](https://img.shields.io/npm/dm/recompose.svg?style=flat-square)](https://www.npmjs.com/package/recompose) Recompose is a React utility belt for function components and higher-order components. Think of it like lodash for React. [**Full API documentation**](docs/API.md) - Learn about each helper [**Recompose Base Fiddle**](https://jsfiddle.net/samsch/p3vsmrvo/24/) - Easy way to dive in ``` npm install recompose --save ``` **📺 Watch Andrew's [talk on Recompose at React Europe](https://www.youtube.com/watch?v=zD_judE-bXk).** *(Note: Performance optimizations he speaks about have been removed, more info [here](https://github.com/acdlite/recompose/releases/tag/v0.26.0))* ### Related modules [**recompose-relay**](src/packages/recompose-relay) — Recompose helpers for Relay ## You can use Recompose to... ### ...lift state into functional wrappers Helpers like `withState()` and `withReducer()` provide a nicer way to express state updates: ```js const enhance = withState('counter', 'setCounter', 0) const Counter = enhance(({ counter, setCounter }) =>
Count: {counter}
) ``` Or with a Redux-style reducer: ```js const counterReducer = (count, action) => { switch (action.type) { case INCREMENT: return count + 1 case DECREMENT: return count - 1 default: return count } } const enhance = withReducer('counter', 'dispatch', counterReducer, 0) const Counter = enhance(({ counter, dispatch }) =>
Count: {counter}
) ``` ### ...perform the most common React patterns Helpers like `componentFromProp()` and `withContext()` encapsulate common React patterns into a simple functional interface: ```js const enhance = defaultProps({ component: 'button' }) const Button = enhance(componentFromProp('component'))