score:3

Accepted answer
componentDidMount: function(){
  function tick(){
    $.ajax({
      url: this.props.url,
      dataType: "JSON",
      type: "GET",
      success:function(data){
        this.setState({data: data});

        this.timer = setTimeout(tick, 500);
      }.bind(this)
    });
  };
  tick();
},
componentWillUnmount: function() {
  clearTimeout(this.timer);
}

Related Query

More Query from same tag