You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import * as React from 'react'
interface Props { test: string }
class El extends React.Component<Props, any> { }
React.createElement(El, { test })
The intellisense of test in the last line is broken:
a. When I start typing test the intellisense is NOT showing test
b. When I finish typing test the intellisense suddenly finds and properly shows test (too late though)
c. If I completely erase test from the last line, I get Property 'test' is missing in type '{}'. error as expected.
I guess the problem is that the intellisense for the second parameter of createElement is be based on the type of the first parameter.
EDIT: It is not React specific. The same issue also appears when using Mithril and other libraries.
The completion list needs overload resolution to work first to be able to provide completions. and in this case overload resolution did not succeed. issue tracked by #8005
From @czb on July 14, 2017 13:43
Steps to Reproduce:
@types/react
test
in the last line is broken:a. When I start typing
test
the intellisense is NOT showingtest
b. When I finish typing
test
the intellisense suddenly finds and properly showstest
(too late though)c. If I completely erase
test
from the last line, I getProperty 'test' is missing in type '{}'.
error as expected.I guess the problem is that the intellisense for the second parameter of
createElement
is be based on the type of the first parameter.EDIT: It is not
React
specific. The same issue also appears when usingMithril
and other libraries.Reproduces without extensions: Yes
Copied from original issue: microsoft/vscode#30709
The text was updated successfully, but these errors were encountered: