React: React 16.3.0. Property 'createRef' does not exist on type 'typeof React'.

Created on 2 Apr 2018  路  1Comment  路  Source: facebook/react

According to new docs on creating Refs in https://reactjs.org/docs/refs-and-the-dom.html.

import * as React from 'react';
...
constructor(props: any) {
    super(props);
    this.fileInputRef = React.createRef()
   }

I upgraded to 16.3.0 but get errors on React.createRef()

Property 'createRef' does not exist on type 'typeof React'.

Most helpful comment

This is a TypeScript error, not a React error. We don't maintain React TS definitions. You'll need to reach out to the maintainers of TS definitions for React and wait for them to release updated typings for React 16.3.

>All comments

This is a TypeScript error, not a React error. We don't maintain React TS definitions. You'll need to reach out to the maintainers of TS definitions for React and wait for them to release updated typings for React 16.3.

Was this page helpful?
0 / 5 - 0 ratings