# recompose
**Repository Path**: mirrors_idris/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-25
- **Last Updated**: 2026-05-24
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
Recompose
-----
[](https://travis-ci.org/acdlite/recompose)
[](https://codecov.io/github/acdlite/recompose)
[](https://codeclimate.com/github/acdlite/recompose)
[](https://www.npmjs.com/package/recompose)
[](https://www.npmjs.com/package/recompose)
[](https://discord.gg/0ZcbPKXt5bWAj4rn)
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/acdlite/69z2wepo/41596/) - 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).**
### 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'))
// renders