Open dengcqw opened 8 years ago
Components are the best way to reuse code in React, but sometimes very different components may share some common functionality. http://facebook.github.io/react/docs/reusable-components.html#mixins
var TickTock = React.createClass({ mixins: [SetIntervalMixin], // Use the mixin ...
通过this可以直接调用SetIntervalMixin中定义的函数
Components are the best way to reuse code in React, but sometimes very different components may share some common functionality. http://facebook.github.io/react/docs/reusable-components.html#mixins