Design Patterns · Middle · Question 37 of 75

What's wrong with mixins (Object.assign(Class.prototype, mixin))?

Explanation

Methods "appear" in the class from who knows where, and mixins can overwrite each other and rely on each other's fields. React dropped mixins back in the class component era; today hooks and composition solve the same problem.

Further reading

Problem with a question

Design Patterns · Middle · question 37

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