× logo Home HTML CSS Javascript React-App Angular.js logo
logo

React HOC introduction

A higher-order component in React is a pattern used to share common functionality between components without repeating code. A higher-order component is actually not a component though, it is a function. A HOC function takes a component as an argument and returns a component. It transforms a component into another component and adds additional data or functionality. In short: HOCs are common in third-party React libraries, such as Redux's connect and Relay's create Container.

logo