Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
InExtremaRes opened this issue Aug 16, 2017 · 2 comments
Closed

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

InExtremaRes opened this issue Aug 16, 2017 · 2 comments
Labels

Comments

@InExtremaRes
Copy link

InExtremaRes commented Aug 16, 2017

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)

@layershifter layershifter changed the title error TS2339: Property 'focus' does not exist on type 'Component<InputProps, ComponentState>' Input: 'focus' method does not exist in typings Aug 16, 2017
@InExtremaRes
Copy link
Author

I do not test but it's very likely that focus method does not exist in others typings as well (as Button, for instance).

@layershifter
Copy link
Member

@InExtremaRes Thanks for notice, TextArea has focus, too. I've updated PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants