---
title: "Discussion on \"Demystifying Higher-Order Components (HOCs)\" | Hashnode"
description: "Discussion on \"Demystifying Higher-Order Components (HOCs)\". The term, ‘Higher-Order components’(usually abbreviated as ‘HOCs’) gets tossed around a lot, and people often tend to misunderstand it. In fact, a good number of React developers don’t exactly know what HOCs are or how they work. And that’s okay. Eve..."
url: "https://hashnode.com/posts/demystifying-higher-order-components-hocs/5d3c63184d97b7262a1d9887"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Demystifying Higher-Order Components (HOCs)](https://josephaje.com/demystifying-higher-order-components-hocs?utm_source=hashnode&utm_medium=feed)

The term, ‘Higher-Order components’(usually abbreviated as ‘HOCs’) gets tossed around a lot, and people often tend to misunderstand it. In fact, a good number of React developers don’t exactly know what HOCs are or how they work. And that’s okay. Eve...

Jul 27, 2019 · 16 min read · josephaje.com  
Updated Jan 22, 2021  
Read the article

-   [#reactjs](https://hashnode.com/tag/reactjs)
-   [#javascript](https://hashnode.com/tag/javascript)
-   [#frontend-development](https://hashnode.com/tag/frontend-development)
-   [#web-development](https://hashnode.com/tag/web-development)

## Written by

[Joseph Aje](https://hashnode.com/@ajejoseph)

@ajejoseph · Lagos, Nigeria

  
[View profile](https://hashnode.com/@ajejoseph)

Software Engineer

## Responses 3

Markdown supported · ⌘↵ to post

[Joseph S Stevens](https://hashnode.com/@josephscottstevens)

[Jul 31, 2019](https://hashnode.com/posts/demystifying-higher-order-components-hocs/5d3c63184d97b7262a1d9887/comment/5d41ee34cb3a19e750304625)

I've been wondering what a higher order component is, thanks for taking the time to break it down into an easily digestible format!

[Joseph Aje](https://hashnode.com/@ajejoseph)

[Jul 31, 2019](https://hashnode.com/posts/demystifying-higher-order-components-hocs/5d3c63184d97b7262a1d9887/comment/5d41ee34cb3a19e750304625#reply-5d41f88dcb3a19e7503046c3)

Always a pleasure to help!

[Tapas Adhikary](https://hashnode.com/@atapas)

[Jul 29, 2019](https://hashnode.com/posts/demystifying-higher-order-components-hocs/5d3c63184d97b7262a1d9887/comment/5d3ef0cb198d23a137b9a5eb)

Nice Read, Thank You!

How do you see HOC will be used by developer with react-hook in picture?

[Joseph Aje](https://hashnode.com/@ajejoseph)

[Jul 30, 2019](https://hashnode.com/posts/demystifying-higher-order-components-hocs/5d3c63184d97b7262a1d9887/comment/5d3ef0cb198d23a137b9a5eb#reply-5d40c947b59ff2cb51d25d51)

Hi Tapas. With the React Hooks API, the code reuse and optimization I highlighted can be achieved easily, and in most scenarios, more gracefully than with HOCs. HOCs are just one way to do it. At the end of the day, it all boils down to preference.

A detailed comparison is available here: [medium.com/@albertchu539/higher-order-components-…](https://medium.com/@albertchu539/higher-order-components-in-a-react-hooks-world-69fe1f0b0791)

[Christian Aracena](https://hashnode.com/@chrisara)

[Jul 28, 2019](https://hashnode.com/posts/demystifying-higher-order-components-hocs/5d3c63184d97b7262a1d9887/comment/5d3dba1698e51e1d11ebd20b)

Excellent breakdown! I've been using HOC's like connect and withStyles (Material-UI) for a bit now but didn't exactly know how they worked until now. Thank you [Joseph Aje](https://hashnode.com/@ajejoseph) !

[Joseph Aje](https://hashnode.com/@ajejoseph)

[Jul 28, 2019](https://hashnode.com/posts/demystifying-higher-order-components-hocs/5d3c63184d97b7262a1d9887/comment/5d3dba1698e51e1d11ebd20b#reply-5d3ddf2498e51e1d11ebd2ae)

Great to see this was helpful. You're welcome!
