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
Type of input at the last line was B | ReactElement
🙂 Expected behavior
Type of input at the last line should be B
The text was updated successfully, but these errors were encountered:
changwoolab
changed the title
Typescript 5.0.2 does not deduce type correctly
Typescript 5.0.2 does not infer type correctly
Mar 19, 2023
changwoolab
changed the title
Typescript 5.0.2 does not infer type correctly
Typescript 5.0.2 does not infer type correctly with React.isValidElement
Mar 19, 2023
Bug Report
After running
tsc
in the console, I got this error.But there was no error in VScode and type inference was working well

Also, there was no error with
4.9.4
.🔎 Search Terms
typescript 5.0, React, ReactElement, isValidElement, inference, deduce
🕗 Version & Regression Information
After upgrading to typescript
5.0.2
and runningtsc
in the console.⏯ Playground Link
Playground link with relevant code
💻 Code
🙁 Actual behavior
Type of input at the last line was
B | ReactElement
🙂 Expected behavior
Type of input at the last line should be
B
The text was updated successfully, but these errors were encountered: