in React JS by
Q:

What is a higher order component?

1 Answer

0 votes
by

A higher-order component (HOC) is an advanced technique in React for reusing component logic. HOCs are not part of the React API. They are a pattern that emerges from React’s compositional nature.

HOC’s allow you to reuse code, logic and bootstrap abstraction. HOCs are common in third-party React libraries. The most common is probably Redux’s connect function. Beyond simply sharing utility libraries and simple composition, HOCs are the best way to share behavior between React Components. If you find yourself writing a lot of code in different places that does the same thing, you may be able to refactor that code into a reusable HOC.

Related questions

0 votes
asked Jul 2, 2019 in React JS by Venkatshastri
0 votes
asked Jun 26, 2020 in React JS by AdilsonLima
...