One issue with the code in your JSFiddle is your use of the shouldComponentUpdate function. As per this should only return a boolean telling React whether to re-render and not try to update the DOM itself. For responding to updates to props you would probably use componentDidUpdate in this case.

Generally if you need to do anything asynchronous in a React component, it should happen in the componentDidMount function, so you're on the right path there.

On other I would try is in createChart() you have"body") - you could select the <div> that you pass in from React as the dom prop and append the <svg> directly there, which would be a much more appropriate way of using React (Components should be self-contained, so they wouldn't go around modifying the DOM outside of themselves. Try'svg').

Hope this is helpful!

PS: I've had some good results using this Plunkr template to create React snippets:

Related Query