Fix compatibility with @iobroker/[email protected]
@iobroker/adapter-react
has switched to default-importing React
, which causes our * as React
imports to break the type declarations.
By enabling esModuleInterop
and dropping the *
import (TypeScript only), we can fix it.
Migration guide:
- Remove the line
"jsx": "react"
fromtsconfig.json
in the project root. - Add
"esModuleInterop": true
and"jsx": "react"
toadmin/tsconfig.json
(insidecompilerOptions
) - TypeScript only: Replace
import * as React from "react"
withimport React from "react"
- TypeScript only: Replace
import * as ReactDOM from "react-dom"
withimport ReactDOM from "react-dom"