Skip to content

Input: 'focus' method does not exist in typings #1970

@InExtremaRes

Description

@InExtremaRes

Steps

This example was tested using create-react-app-typescript

import * as React from 'react';
import * as ReactDOM from 'react-dom';
import { Input } from 'semantic-ui-react';

ReactDOM.render(
    <Input ref={(i) => { if (i) { i.focus(); } }} />,
    document.getElementById('root') as HTMLElement
);

Expected Result

It compiles and work.
The same example works with Babel using ES6 only (no TypeScript, as with create-react-app).

Actual Result

It fails to compile with error:

(6,37): error TS2339: Property 'focus' does not exist on type 'Component<InputProps, ComponentState>'.

Version

0.71.4
(React 15.6.1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions