[Chartjs]-Execute script after loading server side rendered React component

1👍

You can re-render the component again on clientside something like this:

document.onreadystatechange = function () {
    if (document.readyState == "complete") {
        React.render(<RequestView /> ,
            document.getElementById('reactmount')
        );
    }
}

with

componentDidMount: function(){
     if(window){
          var context = document.getElementById('chartId').getContext('2d');
          var chart = new Chart(ctx).Pie(data);
     }
},

Leave a comment