首页 > 其他 > 详细

React中的Statics对象

时间:2016-04-03 14:35:12      阅读:204      评论:0      收藏:0      [点我收藏+]

statics 对象允许你定义静态的方法,这些静态的方法可以在组件类上调用。例如

var MyComponent = React.createClass({
  statics: {
    customMethod: function(foo) {
      return foo === bar;
    }
  },
  render: function() {
  }
});

MyComponent.customMethod(bar);  // true

 

React中的Statics对象

原文:http://www.cnblogs.com/wanghualiang/p/5349697.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!