Components are great to achieve reusability, but what if different components in different domains share the same behavior?
We do not want duplicated code in our applications and React give us a tool that we can use when we want to share functionalities across various components—mixins.
Using mixins is deprecated, but it is worth understanding the problems they try to solve and see what the possible alternative solutions are. Also, it could happen that you might have to work on a legacy project that uses an older version of React, and it makes sense to know what mixins are and how to deal with them.
First of all, mixins work only with the createClass factory, so if you are using classes, you cannot use mixins, and that is one of the reasons why their use is discouraged.
Suppose you are using createClass in your application and you find yourself needing to write...