Design Patterns · Junior · Question 50 of 75

Which pattern does a HOC like withLogger(Component) use?

Explanation

A HOC wraps a component and adds behavior while keeping its interface - a classic decorator. The downsides of HOCs (nesting, prop conflicts) made hooks popular.

Further reading

Problem with a question

Design Patterns · Junior · question 50

Test yourself

Take the Design Patterns · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz