在组件中不同地方this的指向问题

#1
 var MessageBox = React.createClass({
	getInitialState:function(){
		return{
			count:0,
		};
	},
	componentWillMount:function(){
		console.log('will');
		var _this = this;
		this.timer = setInterval(function(){
			_this.setState({
				count:_this.state.count+1,
			});
		},1000);
	},

	closeApp:function(){
		React.unmountComponentAtNode(document.getElementById('app'));
	},

	render:function(){
		console.log('render');
		return(
			<div>
				<h1>hahahah</h1>
				<p>{this.state.count}</p>
				<button onClick={this.closeApp}>shuaxin</button>
			</div>
		);
	},
});

var lifeCC = React.render(
	<MessageBox />,
	document.getElementById('app')
);

在组件装载前设定时器的时候用_this将this储存下来,以便定时器里面用。我用浏览器调试发现_this指向的是组件,定时器里面的_this指向也是组件,而定时器里面的this指向是window。this的指向不是应该指向调用方法的上一级对象么。初学React,在全新的语法上面我都不能判断方法的调用情况,最后总结一下问题,定时器外的this指向是MessageBox还是lifeCC,定时器内的this为什么会指向window??

#2
setInterval = window.setInterval
#3

把setInterval(function() {})改成箭头函数

#4

setInterval 是window对象中的属性 对象中的this指向对象本身,故指向window