Design Patterns · Middle · Question 42 of 75

Which pattern is used in component "slots" (<Card header={...} footer={...}>)?

Explanation

Slots (children, named props with JSX) let you extend a component without adding a flag for every case. It's a direct application of "composition over inheritance" and OCP.

Further reading

Problem with a question

Design Patterns · Middle · question 42

Test yourself

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

Take this quiz