Skip to content

Commit 5ea198e

Browse files
committed
react: Fix type augmentation for giscus-widget
1 parent 25a7bf9 commit 5ea198e

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

react/src/vite-env.d.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
/// <reference types="vite/client" />
22

3-
interface GiscusWidgetAttributes {
3+
import { HTMLAttributes } from 'react';
4+
5+
interface GiscusWidgetAttributes extends HTMLAttributes<HTMLElement> {
46
id?: string;
57
host?: string;
68
repo: `${string}/${string}`;
@@ -18,8 +20,10 @@ interface GiscusWidgetAttributes {
1820
loading?: import('./lib/types').Loading;
1921
}
2022

21-
declare namespace JSX {
22-
interface IntrinsicElements {
23-
'giscus-widget': GiscusWidgetAttributes;
23+
declare module 'react' {
24+
namespace JSX {
25+
interface IntrinsicElements {
26+
'giscus-widget': GiscusWidgetAttributes;
27+
}
2428
}
2529
}

0 commit comments

Comments
 (0)