mixins is a React feature that allows you to share cross cutting concerns with components. A mixin is simply an Object Literal that is used to add behavior to a component. It's an implementation of the decorator pattern and the mixin you create can provide implementations of React's component lifecycle events (componentWillMount, componentDidMount, and so on) and those will be called during your component's lifecycle along with the component's lifecycle methods.


Here are the details from React's documentation:

A nice feature of mixins is that if a component is using multiple mixins and several mixins define the same lifecycle method (i.e. several mixins want to do some cleanup when the component is destroyed), all of the lifecycle methods ...

Get Mastering React now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.