title: Script is not executed in React JS
body: <p>I am trying to draw rectangle with one diagonal line using canvas and script. But, unfortunately rectangle alone is getting displayed in my browser. It looks like the script is not executed.</p>
  
  <p>Code:</p>
  
  <pre><code>import React, { Component } from 'react';
  import '../App.css';
  
  class Graphics extends Component{
  
      render(){
          return(
              &lt;div id="canvas"&gt;
              Draw a diagonal Line in Rectangular
  
              &lt;canvas id="myCanvas" className="canvas-style" width="200" height="100"&gt;
  &lt;/canvas&gt;
  &lt;script&gt;
  var c = document.getElementById("myCanvas");
  var ctx = c.getContext("2d");
  ctx.moveTo(0,0);
  ctx.lineTo(200,100);
  ctx.stroke();
  &lt;/script&gt;
  &lt;/div&gt;
          );
      }
  }
  
  export default Graphics;
  </code></pre>