title: creating svg node on ref with typescript?
body: <p>I am trying to create a ref on react+typescript:</p>
  
  <pre><code>class BarChart extends Component {
    private node: React.RefObject&lt;SVGSVGElement | null&gt;;
    constructor(props) {
      super(props);
      this.node = React.createRef();
    }
  ... 
  }
  </code></pre>
  
  <p>this is the svg code i am trying to refer: </p>
  
  <pre><code>&lt;svg ref={node =&gt; (this.node = node)} width={500} height={500} /&gt;
  </code></pre>
  
  <p>but i get this error:</p>
  
  <pre><code>Type 'SVGSVGElement | null' is not assignable to type 'RefObject&lt;SVGSVGElement | null&gt;'.
    Type 'null' is not assignable to type 'RefObject&lt;SVGSVGElement | null&gt;'.
  </code></pre>
  
  <p>help? i am new in ts</p>