ReactHigher Order Components

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.

Related Examples

Higher Order Component that checks for authentication