Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error TS2602: JSX element implicitly has type 'any' because the global type 'JSX.Element' does not exist

Even though I've installed & referenced the Typings library 'react' like this

/// <reference path="../../../typings/browser.d.ts" />

I'm still getting the error below: enter image description here

Is there another Typings library I should be installing as well?

like image 682
Richard Avatar asked Jun 07 '16 08:06

Richard


People also ask

How do you fix JSX element implicitly has Type any because no interface JSX IntrinsicElements exists?

To solve the error "JSX element implicitly has type 'any' because no interface 'JSX. IntrinsicElements' exists", make sure to install the typings for react running the command npm install --save-dev @types/react@latest @types/react-dom@latest and restart your IDE. Copied!

Does not exist on type JSX IntrinsicElements TS?

The error "Property does not exist on type 'JSX. IntrinsicElements'" occurs when a component's name starts with a lowercase letter. To solve the error, make sure to always start component names with a capital letter, install the types for React and restart your dev server.


2 Answers

I resolved this issue by installing the react type definition.

Try to run yarn add --dev @types/react

like image 156
Daniel Dyrnes Avatar answered Sep 27 '22 23:09

Daniel Dyrnes


I solved this issue by reloading VSCode.

Ctrl + p > Developer: Reload Window

like image 34
Gustavo Maximo Avatar answered Sep 27 '22 23:09

Gustavo Maximo