# recompose
**Repository Path**: mirrors_fis-components/recompose
## Basic Information
- **Project Name**: recompose
- **Description**: Fork from https://github.com/acdlite/recompose.git
- **Primary Language**: Unknown
- **License**: Not specified
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2020-08-08
- **Last Updated**: 2025-12-13
## 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.
```
npm install recompose --save
```
### Related modules
- [**recompose-relay**](https://github.com/acdlite/recompose/tree/master/src/packages/recompose-relay) — Recompose helpers for Relay
- [**rx-recompose**](https://github.com/acdlite/recompose/tree/master/src/packages/rx-recompose) — RxJS utilities for Recompose and React
## 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 Counter = withState(
'counter', 'setCounter', 0,
({ 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 Counter = withReducer(
'counter', 'dispatch', counterReducer, 0,
({ 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 Button = defaultProps(
{ component: 'button' },
componentFromProp('component')
)
// renders