Higher Order Components
suggest changeVersions
[{“Name”:“15.0.0”,“GroupName”:null},{“Name”:“15.1.0”,“GroupName”:null},{“Name”:“15.2.0”,“GroupName”:null},{“Name”:“15.2.1”,“GroupName”:null},{“Name”:“15.3.0”,“GroupName”:null},{“Name”:“15.3.1”,“GroupName”:null},{“Name”:“15.3.2”,“GroupName”:null},{“Name”:“15.4.0”,“GroupName”:null},{“Name”:“15.4.1”,“GroupName”:null},{“Name”:“15.4.2”,“GroupName”:null},{“Name”:“15.5.0”,“GroupName”:null}]
Introduction
Higher Order Components (“HOC” in short) is a react application design pattern that is used to enhance components with reusable code. They enable to add functionality and behaviors to existing component classes.
A HOC is a pure javascript function that accepts a component as it’s argument and returns a new component with the extended functionality.
Remarks
HOCs are pretty often used in third party libraries. Such as the Redux connect function.