Sharing behaviour between React components
mixins option passed to
createClass. So now we get to review mixins as a pattern for behaviour sharing and, if necessary, come up with something better. If they're not all bad, we'll need to figure out how to, or even if we can, add them to the two new component definition options.
Dan Abromov's medium article from Mar 2015 makes the case for avoiding mixins.
For me (paraphrasing in the extreme), the key problems exposed are:
- mixins can unintentionally hide / distribute the source of behaviour