title: Why getContext function cannot be called on React JSX <canvas> object?
body: <p>I have the following code in a React.Component subclass</p>
  
  <pre><code>class SearchObject extends React.Component { 
  
      constructor(props) {
          super(props)
  
          var activateCanvas = &lt;canvas&gt;&lt;/canvas&gt;
  
          var activateDraw = () =&gt; {
              let ctx = activateCanvas.getContext('2d')
              //draw stuff
          }
  
          activateDraw()
  
          this.state = {
              activate: activateCanvas
          }
      }
  ...
  </code></pre>
  
  <p>the <code>activateCanvas.getContext('2d')</code> line returned error, saying getContext is not a function.
  I wonder why activateCanvas here is not an Element object. Do I have to wait until the element is rendered and call something like document.getElementById() to use getContext()? Thanks</p>