title: ReactJS and Typescript : refers to a value, but is being used as a type here (TS2749)
body: <p>I'm coding a ReactJS class with Typescript and Material-ui, in a .tsx file. In one of my custom components, I want to create a reference to one of the components that I use in my custom component.</p>
  
  <pre><code>export class MyTextField extends React.Component&lt;MyProps, MyState&gt; {
    private refTextField: React.RefObject&lt;TextField&gt;;
    constructor(props: MyProps) {
      super(props);
      this.refTextField = React.createRef();
    }
  
    render(): JSX.Element {
      const { id, label, value: defaultValue } = this.props;
      const { value } = this.state;
      const element = (
        &lt;TextField ref={this.refTextField} id={id} label={label} defaultValue={defaultValue} value={value} /&gt;
      );
  
      return element;
    }
  }
  </code></pre>
  
  <p>During compilation, I get an error on the declaration of my reference:</p>
  
  <blockquote>
    <p>'TextField' refers to a value, but is being used as a type here. TS2749</p>
  </blockquote>
  
  <p>I tried to put "typeof TextField" in my declaration, but I have another message, when valuing the ref property in my render :</p>
  
  <blockquote>
    <p>Type 'RefObject&lt;(props: TextFieldProps) => Element>' is not assignable
    to type '((instance: HTMLDivElement | null) => void) |
    RefObject | null | undefined'.     Type
    'RefObject&lt;(props: TextFieldProps) => Element>' is not assignable to
    type 'RefObject'.
        Type '(props: TextFieldProps) => Element' is missing the following properties from type 'HTMLDivElement': align, addEventListener,
    removeEventListener, accessKey, and 238 more. TS2322</p>
  </blockquote>
  
  <p>Any ideas ?
  thank you so much</p>