Recompose is a React utility belt for function components and higher-order components. Think of it like lodash for React. You can use Recompose to lift state into functional wrappers, perform the most common React patterns, optimize rendering performance, interoperate with other libraries, build your own libraries, etc. Recompose helpers integrate really nicely with external libraries like Relay, Redux, and RxJS. Recompose focuses on higher-order components. HoCs are functions that accept a base component and return a new component with additional functionality. They can be used to abstract common tasks into reusable pieces. Recompose provides a toolkit of helper functions for creating higher-order components. Many React libraries end up implementing the same utilities over and over again, like shallowEqual and getDisplayName. Recompose provides these utilities for you. Although Recompose encourages the use of function components whenever possible it works with normal React components.
Features
- Lift state into functional wrappers
- Perform the most common React patterns
- Optimize rendering performance
- Interoperate with other libraries
- Build your own libraries
- Recompose focuses on higher-order components