Answer the question
In order to leave comments, you need to log in
What is the difference between higher-order components and decorators?
What is the difference between higher order components and decorators?
Answer the question
In order to leave comments, you need to log in
In simple words..
A decorator is a function that takes another function (let's call it "basic") as input and returns a third function that calls/uses the base one under its hood.
HOC is a special case of a decorator when the underlying function is a React component.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question