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 { JSX } from "hono/jsx";
type ButtonProps = JSX.IntrinsicElements["button"];
interface ButtonPropsInterface extends ButtonProps {};
// An interface can only extend an identifier/qualified-name with optional type arguments.deno-ts(2499)
interface ButtonPropsInterface2 extends JSX.IntrinsicElements["button"] {
}
Code using ButtonPropsInterface runs fine, but ButtonPropsInterface2 gives a Typescript error. As far as I can tell, the ButtonHTMLAttributes referenced by JSX.IntrinsicElements["button"] doesn't have type arguments, so I don't see why this would be an issue. Why doesn't the compiler complain when I extend the alias, should extending JSX.IntrinsicElements["button"] be prohibited and I'm just tricking it?
Thanks!
The text was updated successfully, but these errors were encountered:
Version: Deno 2.1.4
Apologies if i'm overlooking something obvious! I'm trying to extend JSX.IntrinsicElements in Hono.
I have the following code:
Code using
ButtonPropsInterface
runs fine, but ButtonPropsInterface2 gives a Typescript error. As far as I can tell, theButtonHTMLAttributes
referenced byJSX.IntrinsicElements["button"]
doesn't have type arguments, so I don't see why this would be an issue. Why doesn't the compiler complain when I extend the alias, should extendingJSX.IntrinsicElements["button"]
be prohibited and I'm just tricking it?Thanks!
The text was updated successfully, but these errors were encountered: