alex-kinokon / jsx-dom

Use JSX to create DOM elements.
BSD 3-Clause "New" or "Revised" License
278 stars 30 forks source link

JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. #76

Closed kuoruan closed 2 years ago

kuoruan commented 2 years ago

The source files: https://codesandbox.io/s/quirky-agnesi-dnn33?file=/src/index.tsx

I'm using js-dom with babel React Automatic Runtime, but how can i import the jsx-dom types?

I have created a jsx-env.d.ts with content:

/// <reference types="jsx-dom" />

But it still rise the error that cannot find JSX.IntrinsicElements

kuoruan commented 2 years ago

Found a way to fix this: https://stackoverflow.com/a/43792209

import { JSX } from "jsx-dom";

export as namespace JSX;
export = JSX;